Reputation: 131
I have a very strange problem since yesterday. If I use the run-button in Android Studio SOMETIMES Android Studio cannot complete the Gradle execution.
In the gradle console in Android Studio I first get the message:
:app:compileDevelopmentDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Followed by:
:app:dexDevelopmentDebug
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(org.apache.commons.httpclient.HttpMethodBase$1) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
Then the gradle console said BUILD SUCCESSFUL but Android Studio gives me the error message "Gradle Running Failed to complete Gradle execution" but without a cause (its empty, see picture).
The run button is not clickable any more and I have to click "sync project with gradle files". Afterwards I am able to run the app a few times (on device) without any of the error messages posted above. After a few times the same error message(s) are showing up again.
Upvotes: 0
Views: 3598
Reputation: 616
In my case the problem was solved by building the Gradle in the previous directory.
Initially I had the project in a different directory and when i moved it to the other directory it showed the above error but after moving it back to the previous directory error sorted.
Hope it'll help.
Upvotes: 1
Reputation: 2137
Sometimes, gradle give this error but you can run your app without problem. Otherwise, If the problem is with plugins or with any other boilerplate code the gradle might not show the error.
In this scenario, you can see the problem opening the terminal tab and executing this command:
gradlew assembleDebug --stacktrace
After this, you can see errors logs if exists.
Upvotes: 0
Reputation: 131
With an update to the newest Android Studio Version 1.3 (beta), the problem is gone. The console shows the same warnings but Android Studio does not fail.
Upvotes: 1