aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java
index 770710d..c850a2a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java
@@ -24,6 +24,8 @@ import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
import com.android.ide.eclipse.adt.internal.project.ProjectHelper;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.sdklib.IAndroidTarget;
import com.android.utils.Pair;
import org.eclipse.core.resources.IFolder;
@@ -110,6 +112,20 @@ public class ResourceManagerBuilder extends BaseBuilder {
errorMessage = String.format(errorMessage,
result.getSecond() == null ? "(no value)" : result.getSecond());
+ if (JavaCore.VERSION_1_7.equals(result.getSecond())) {
+ // If the user is trying to target 1.7 but compiling with something older,
+ // the error message can be a bit misleading; instead point them in the
+ // direction of updating the project's build target.
+ Sdk currentSdk = Sdk.getCurrent();
+ if (currentSdk != null) {
+ IAndroidTarget target = currentSdk.getTarget(project.getProject());
+ if (target != null && target.getVersion().getApiLevel() < 19) {
+ errorMessage = "Using 1.7 requires compiling with Android 4.4 " +
+ "(KitKat); currently using " + target.getVersion();
+ }
+ }
+ }
+
markProject(AdtConstants.MARKER_ADT, errorMessage, IMarker.SEVERITY_ERROR);
AdtPlugin.printErrorToConsole(project, errorMessage);