Error:Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'.
Tried everything, Android Studio still does not works. Re-installed 10 times, cleaned all .gradle .android folder. Created example project from scratch. Tried changing the gradle version. Nothing almost nothing works.
There is no system gradle, my Java version is javac 1.8.0_40
Contents of gradle config
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here are the contents of idea.log
2015-11-08 22:40:39,654 [ 471024] WARN - nal.AbstractExternalSystemTask - Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'.
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:106)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:158)
at org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.getUserFriendlyError(BaseGradleProjectResolverExtension.java:438)
at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:348)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:164)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:366)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:332)
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:225)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:97)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:65)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.execute(ExternalSystemUtil.java:540)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5$2.run(ExternalSystemUtil.java:621)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:400)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
2015-11-08 22:40:39,655 [ 471025] WARN - radle.project.ProjectSetUpTask -
2015-11-08 22:40:39,655 [ 471025] INFO - radle.project.ProjectSetUpTask - Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'.
Consult IDE log for more details (Help | Show Log)
2015-11-08 22:40:39,655 [ 471025] INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle for project 'My Application' failed: Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'.
Based on suggestions I installed gradle seperately, I had to fix this error https://issues.gradle.org/browse/GRADLE-1451 but I now have ANDROID_HOME, gradle defined and gradle --version works.
------------------------------------------------------------
Gradle 2.7
------------------------------------------------------------
Build time: 2015-09-14 07:26:16 UTC
Build number: none
Revision: c41505168da69fb0650f4e31c9e01b50ffc97893
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_40 (Oracle Corporation 25.40-b25)
OS: Mac OS X 10.9.5 x86_64
**Yet I am still getting the same error from Android Studio. Also in a bizarre manner it simply refuses to accept the gradle home folder, always showing error that Gradle home folder is incorrect, even when I used lib or bin sub directory the error still remains. And it automatically switches back to the wrapper. **
Error:Could not create an instance of Tooling API implementation using the specified Gradle installation '/Users/aub3/gradle'.
When built from command like using 'gradle build' I get following error
:app:compileReleaseSources
:app:preDexRelease
:app:dexRelease
:app:packageRelease
:app:assembleRelease
:app:assemble
:app:compileLint
:app:lint
Ran lint on variant debug: 4 issues found
Ran lint on variant release: 4 issues found
Wrote HTML report to file:/Users/aub3/IdeaProjects/Dsdsadasd/app/build/outputs/lint-results.html
Wrote XML report to /Users/aub3/IdeaProjects/Dsdsadasd/app/build/outputs/lint-results.xml
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:processDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestJavaWithJavac
:app:compileDebugUnitTestSources
:app:mockableAndroidJar
:app:assembleDebugUnitTest
:app:testDebugUnitTest
java.lang.ClassCastException: ch.qos.logback.classic.LoggerContext cannot be cast to org.gradle.logging.internal.slf4j.OutputEventListenerBackedLoggerContext
at org.gradle.logging.internal.slf4j.Slf4jLoggingConfigurer.configure(Slf4jLoggingConfigurer.java:42)
at org.gradle.logging.internal.DefaultLoggingConfigurer.configure(DefaultLoggingConfigurer.java:34)
at org.gradle.logging.internal.LoggingSystemAdapter.setLevel(LoggingSystemAdapter.java:55)
at org.gradle.logging.internal.LoggingSystemAdapter.on(LoggingSystemAdapter.java:42)
at org.gradle.logging.internal.DefaultLoggingManager$StartableLoggingSystem.start(DefaultLoggingManager.java:191)
at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:60)
at org.gradle.logging.internal.DefaultLoggingManager.start(DefaultLoggingManager.java:31)
at org.gradle.process.internal.child.ImplementationClassLoaderWorker.execute(ImplementationClassLoaderWorker.java:58)
at org.gradle.process.internal.child.ImplementationClassLoaderWorker.execute(ImplementationClassLoaderWorker.java:41)
at org.gradle.process.internal.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:49)
at org.gradle.process.internal.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:33)
at jarjar.org.gradle.process.internal.launcher.GradleWorkerMain.run(GradleWorkerMain.java:69)
at jarjar.org.gradle.process.internal.launcher.GradleWorkerMain.main(GradleWorkerMain.java:74)
:app:testDebugUnitTest FAILED
FAILURE: Build failed with an exception.
I finally got gradle to assemble android project and install on a devide via gradle installDebug task using command line. Android Studio however still does NOT works.
Error:Could not create an instance of Tooling API implementation using the specified Gradle installation '/Users/aub3/gradle'.
Solved
I could get gradle wrapper to work with following
DEFAULT_JVM_OPTS="-Djava.ext.dirs="
However there is no way to use this setting with Android Studio.
Also unlike what I read online , there are multiple directories
[java.ext.dirs] = /Users/aub3/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java.
I went to each directory and removed Jar files for Loggers, sl4j and others. With this I was able to get Android Studio to work.
Check for conflicts in /Library/Java/Extensions.
In my case, I had logback-classic.jar, logback-core.jar, slf4j-api.jar and xuggle-xuggler.jar all soft-linked from some directory /usr/local/xuggler/share/java/jars/ (which I don't recall what may have installed it).
I just put these files (or links) away and now I'm able to use Gradle both from the command line and from within Android Studio. (I created a script to restore the soft-links in case my setup is broken somewhere else, but so far, I haven't run into any problems).
You can Download GRADLE on website. Gradle Download.
Save on any directory (example: /Users/ihojose/Documents/gradle).
Open Console and add system variable.
vi ~/.profile
Copy and paste the following text into the .profile file:
GRADLE_HOME=/Users/ihojose/Documents/gradle;
export GRADLE_HOME
export PATH=$PATH:$GRADLE_HOME/bin
Test gradle in console
gradle -version
If result if similar to this:
------------------------------------------------------------
Gradle 1.0-rc-3
------------------------------------------------------------
Gradle build time: Monday, Novenber 9, 2015 16:10:52 PM UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 2.6.0 compiled on October 21 2015
Ivy: 2.2.0
JVM: 1.8.0_68 (Apple Inc. 20.6-b01-415)
OS: Mac OS X 11.0.1 x64
Define ANDROID_HOME
Click here for How to define ANDROID_HOME
Now you can use Android Studio.
Related
I have a project that compiles fine when I run ANDROID_HOME=/.../Library/Android/sdk gradle clean assembleDebug. But when I try to run the same on a github action like this...
on:
push:
branches:
- '**'
jobs:
test:
name: Analyze Android
runs-on: ubuntu-latest
steps:
- name: Checkout App
uses: actions/checkout#v2
- uses: actions/setup-java#v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action#v2
- name: Setup Android SDK
uses: android-actions/setup-android#v2
- name: Assemble
run: |
./gradlew clean assembleDebug
I get
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve project :DTO.
Required by:
project :app
project :app > project :UI
project :app > project :Data
project :app > project :Domain
> No matching configuration of project :DTO was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.2.1', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
But the DTO project does exist and as I said works locally. I checked the versions and they look to be the same...
------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 15.0.2 (Oracle Corporation 15.0.2+7-27)
OS: Mac OS X 10.16 x86_64
------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.16 (Eclipse Adoptium 11.0.16+8)
OS: Linux 5.15.0-1014-azure amd64
Why does it work locally but not via Github Actions?
Updates
It looks like it is because the library is setup like this...
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
}
instead of like the rest...
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}
So it finds the others but not this one. But I tried converting to an android app and I get the same issue.
In my case it was because my local box was OSX (not case sensitive) and the build box was Ubuntu (case sensitive). Once the name was lowercased it worked.
I think your computer doesn't have enough space(RAM) for Build. I also faced the similar issue but it got resolved when I Increased my internal ram.
My task is defined inside app/build.gradle
rootProject.configurations has no configuration while configurations has everything e.g. "implementation", "testImplementation" etc.
Why?
------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------
Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d
Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)
OS: Mac OS X 10.14.6 x86_64
The build.gradle file in the app folder defines a sub module (or sub project). The build.gradle file in the root folder defines the root project.
The configurations are added by plugins and in most use cases there is no need to apply a plugin in the root project.
I have a problem with publishing multi-flavor library to jitpack.
The log says that build success but the status is error
I've followed instructions on jitpack site but their sample uses old gradle version and it did not work with gradle 4.4
Here is the log:
Build starting...
Start: Fri Apr 20 07:35:56 UTC 2018
Git:
1.28.1-1-g932f4d8
commit 932f4d88e13b1c8c52b4dbae8c203e7d52a0eadf
Author: yzheka
Date: Fri Apr 20 10:34:49 2018 +0300
jitpack config
Run gradle build
Gradle build script
Found gradle version: 4.4.
Using gradle wrapper
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
Downloading https://services.gradle.org/distributions/gradle-4.4-all.zip
..............................................................................................
Unzipping /home/jitpack/.gradle/wrapper/dists/gradle-4.4-all/9br9xq1tocpiv8o6njlyu5op1/gradle-4.4-all.zip to /home/jitpack/.gradle/wrapper/dists/gradle-4.4-all/9br9xq1tocpiv8o6njlyu5op1
Set executable permissions for: /home/jitpack/.gradle/wrapper/dists/gradle-4.4-all/9br9xq1tocpiv8o6njlyu5op1/gradle-4.4/bin/gradle
------------------------------------------------------------
Gradle 4.4
------------------------------------------------------------
Build time: 2017-12-06 09:05:06 UTC
Revision: cf7821a6f79f8e2a598df21780e3ff7ce8db2b82
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Linux 4.14.15-xxxx-std-ipv6-64 amd64
0m4.923s
Getting a list of gradle tasks
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
Running: ./gradlew clean -Pgroup=com.github.yzheka -Pversion=-1.28.1-g932f4d8-1 -xtest -xlint install
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
:clean
:app:clean UP-TO-DATE
:busybox:clean UP-TO-DATE
:busybox:install
BUILD SUCCESSFUL in 0s
4 actionable tasks: 2 executed, 2 up-to-date
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all
EXIT_CODE=0
2018-04-20T07:36:32.030445377Z
Exit code: 0
No build artifacts found
In jitpack log you can see why jitpack can't publish your library. Just delete some part of your code because of jitpack error.
Cannot get the value of write-only property 'publishNonDefault' for object of type com.android.build.gradle.LibraryExtension.
if( android.publishNonDefault && variant.name == android.defaultPublishConfig ) {
def bundleTask = tasks["bundle${name.capitalize()}"]
artifacts {
archives(bundleTask.archivePath) {
classifier null
builtBy bundleTask
}
}
}
}
}
Then jitpack do not show the error when publishing your library. Works like a charm. To publish your library just realese once again then publish your libary.
I just made it for you as an example see the repository which I forked from you here https://github.com/markizdeviler/Busybox
This way is worked for me:
Add these line in the Module gradle after dependencies part :
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.github.yourgitid' //your git id
artifactId = 'Myket-Intent' //your-repository
version = '0.1.15' // same as Tag
}
}
}
}
after that you can see:
BUILD SUCCESSFUL in 41s
123 actionable tasks: 120 executed, 3 up-to-date
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
Found artifact: com.github.Mori-hub:Myket-Intent:0.1.15
2022-01-22T09:38:10.889110195Z
Exit code: 0
Build artifacts:
com.github.Mori-hub:Myket-Intent:0.1.15
I am new in Android studio & Gradle.
My project structure is like this:
MyProject
-LibModuleOne
-...
-build.gradle
-LibModuleTwo
- ...
-buld.gradle
-AppModule
-...
-build.gradle
buld.gradle
On command line, under MyProject/ , ./gradlew --version shows me that I am using gradle 2.1:
./gradlew --version
------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------
Build time: 2014-09-08 10:40:39 UTC
Build number: none
Revision: e6cf70745ac11fa943e19294d19a2c527a669a53
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
OS: Mac OS X 10.8.5 x86_64
But, if I check the version under MyProject/LibModuleOne/ or MyProject/LibModuleTwo/ or MyProject/AppModule/ they all show me that I am using gradle 1.12:
./gradlew --version
------------------------------------------------------------
Gradle 1.12
------------------------------------------------------------
Build time: 2014-04-29 09:24:31 UTC
Build number: none
Revision: a831fa866d46cbee94e61a09af15f9dd95987421
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
Ivy: 2.2.0
JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
OS: Mac OS X 10.8.5 x86_64
The build.gradle of project root declares using Android plugin version0.13.3 :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.3'
}
}
In Android studio, File-->Project structure --> shows Gradle 2.1
Why gradle wrapper shows different version in sub-modules than project root ? How to make all my sub-modules use Gradle 2.1 ?
You appear to have multiple wrappers installed (otherwise ./gradlew wouldn't work from subdirectories). You need to remove all gradlew scripts and gradle/wrapper directories except for the ones in the root project's directory.
i was trying to follow this tutorial:
http://www.gdgankara.org/2012/11/01/step-by-step-android-development-with-maven/
but after setting up the environment, and create a project, at the "run as\maven install" step i got this:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tutorial 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- android-maven-plugin:3.1.1:generate-sources (default-generate-sources) # tutorial ---
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.889s
[INFO] Finished at: Sat May 18 00:32:12 CEST 2013
[INFO] Final Memory: 8M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project tutorial: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
I've tried lot of times, but with no luck.
I have Eclipse Juno on Windows7 64 bit, APK Tool installed and Maven 3.0.5.
It seems a well known problem for maven staff:
https://code.google.com/p/maven-android-plugin/issues/detail?id=104
but it should be solved from ages...
My Environment User variables:
M2_HOME=C:\Program Files\Java\apache-maven-3.0.5
ANDROID_HOME=C:\adt-bundle-windows-x86_64-20130514\sdk
My Environment System variable:
Path=......;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\build-tools;%ANDROID_HOME%\platforms;%M2_HOME%\bin;%ANDROID_HOME%\build-tools\android-4.2.2
Does anybody know how to workout this trap?
thanks!
I also encountered the same problem when using latest ADT from google and trying to compile the bootstrap android platform.
The latest r17 build separate out aapt to build-tools folder. Hence it is maven-android-plugin cannot support it.
See issue discussed here.
Tried and working:
cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/android-4.2.2/aapt aapt
ln -s ../build-tools/android-4.2.2/lib lib
ln -s ../build-tools/android-4.2.2/aidl aidl
Some installations may be structured using the API version:
cd $ANDROID_HOME/platform-tools
ln -s ../build-tools/17.0.0/aapt aapt
ln -s ../build-tools/17.0.0/lib lib
ln -s ../build-tools/17.0.0/aidl aidl
Keep in mind that this is fixed in the latest version (>3.5.3) of the Android Maven Plugin, as other answers point out.
Update:
This has been resolved since Android Maven Plugin v3.6.0. For now you will only need these symlinks if you use IntelliJ v12.x. IntelliJ v13 EAP+ should work out of the box.
Original answer:
This has been fixed and will be released with Android Maven Plugin v3.5.4. See the github pull request:
Upgraded AndroidSdk to use path and platform utilities from sdklib
You can try validating the snapshot build which contains the fix by adding the following to your pom.xml:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.4-SNAPSHOT</version>
...
</plugin>
...
<pluginRepositories>
<pluginRepository>
<id>oss.sonatype.org-jayway-snapshots</id>
<name>Jayway OpenSource SNAPSHOTs on Sonatype.org</name>
<url>http://oss.sonatype.org/content/repositories/jayway-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Please provide feedback on the developer group:
New snapshot for 3.5.4 available
If you are using Windows, the symbolic linking can be done using mklink command.
D:\>cd "Program Files (x86)\Android\android-sdk"
D:\Program Files (x86)\Android\android-sdk>cd platform-tools
D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink aapt.exe ..\build-tools\17.0.0\aapt.exe
symbolic link created for aapt.exe <<===>> ..\build-tools\17.0.0\aapt.exe
D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink aidl.exe ..\build-tools\17.0.0\aidl.exe
symbolic link created for aidl.exe <<===>> ..\build-tools\17.0.0\aidl.exe
D:\Program Files (x86)\Android\android-sdk\platform-tools>mklink /d lib ..\build-tools\17.0.0\lib
symbolic link created for lib <<===>> ..\build-tools\17.0.0\lib
I get stuck with the same problem. Finally i managed to resolve the issue after two hours. To make it simple and resolve the issue in 5 minutes i listed the steps below
Step 1 - In Eclipse update your Android Maven Plugin to 0.4.3.2013 using the beta release link
http://rgladwell.github.io/m2e-android/updates/master/
Step 2
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<sdk>
<platform>17</platform>
</sdk>
</configuration>
</plugin>
It will solve the following issues
"No Android Platform Version/API Level has been configured"
Could not find tool 'aapt'
Hope it helps
I too had similar problems.
Solved by following steps :
1) Upgrade maven to 3.1.1
2) Use android-maven-plugin 3.6.1 pr greater [I used 3.8.0]
3) Use maven-dependency-plugin 2.8
If you want to build against latest Android SDK [ex : 4.3], follow following additional steps -
4) Install the local copy of android.jar using command mvn install:installFile ..
5) Set 18
Hope this helps.
I'm using macOS 10.14 and in my case:
I download Android packaging tool from AAPT and then copied all the files into $ANDROID_HOME/platforms/$SDK/tools/
DON'T REMIND CHANGE $SDK WITH YOUR REAL NAME SDK FOR INSTANCE android-29