I just tried out Android Studio 4.1 today. I started the Android Studio and created empty activity and I run it using the android virtual device. Then it was failed and this error is shown:
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
> File 'E:\Project\AndroidLayout\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
When I rebuild the project, the error message is shown here:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Project\AndroidLayout\app\build\intermediates\navigation_json\debug\navigation.json (The system cannot find the path specified)
Note that this is fresh install and fresh project without any modification in the code.
UPDATE 1:
Youtube: https://www.youtube.com/watch?v=g4w_NOA_UVQ
Bug Report: https://issuetracker.google.com/issues/170720311
UPDATE 2:
After I downgrade the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working.
So my conclusion is there is a bug in the Android Gradle Plugin 4.1.+ and Gradle 6.5.+.
I find a temporary solution:
After I downgrade the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working. So my conclusion is there is a bug in the Android Gradle Plugin 4.1.+ and Gradle 6.5.+.
In order to downgrade, just go to File -> Project Structure.
Had same issue. Moving project files to ntfs drive fixed it.
Downgrading the Android Gradle Plugin version from 4.1.0 to 4.0.2 and the Gradle version from 6.5 to 6.4.1 now it is working; works for me as well. Now app is no longer experiencing building errors.Thanks.
Error message was :
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
File 'F:\NietsPastApp\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
Thanks for help, downgrade it's ok. just for other who search the file :
gradle 4.0.2 change here : /build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
gradle 6.4.1 : gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
File -> Project Structure. reduce your build tools version to 29
i tried it's work
In my case and for kotlin I have downgraded kotlin version from 1.4.32 to 1.4.31
Related
I'm trying to upgrade to the latest version of React Native. When I run my Android app (npx react-native run-android) it gives this error:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 7.4. Current version is 7.3.1. If using the gradle wrapper, try editing the distributionUrl in /Users/justintoth/Dev/m365-mobile-app/android/gradle/wrapper/gradle-wrapper.properties to gradle-7.4-all.zip
Seems simple enough, that I need to upgrade Gradle from version 7.3.1 to version 7.4. However, when I make the following changes:
android/build.gradle (dependencies section):
classpath("com.android.tools.build:gradle:7.4")
android/gradle/wrapper/gradle-wrapper.properties:
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip
Then it gives this error:
> Could not find com.android.tools.build:gradle:7.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/7.4/gradle-7.4.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.4/gradle-7.4.pom
Required by:
project :
So what gives? It errors if I use version 7.3.1 and insists I use 7.4, and yet when I use 7.4 it says it can't find it. The distributionUrl that I specified in gradle-wrapper.properties is correct, so it's clearly ignoring it and just trying to look in google, jcenter and mavenCentral.
I have been trying to run my flutter app through an emulator but I end up getting an error in the app/build.gradle section. Below is the error message, any insights to this will help
What went wrong: A problem occurred evaluating project ':app'. > Failed to apply plugin 'kotlin-android'. > The current Gradle version 6.7 is not compatible with the Kotlin Gradle plugin. Please use Gradle 6.7.1 or newer, or the previous version of the Kotlin plugin.
Go to android folder in the project ==> gradle ==> gradle-wrapper.properties
then change the distributionUrl to
==> distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip
I faced the problem, more correct in gradle, when I enter the command - npx react-native run-android into the console - it gives me the following error :
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'Da'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find com.android.tools.build:gradle:6.4.1.
Searched in the following locations>
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.4.1/gradle-6.4.1.pom -https://jcenter.bintray.com/com/android/tools/build/gradle/6.4.1/gradle-6.4.1.pom
Initially - the problem was incompatibility between gradle and android versions, but after i changed version of gradle and terminal automatically download new version into directory, first error disappeared, but i got another (current problem). I had try some advice before asking question in StackOverFlow, but they didn't work. Here some characteristics :
React-Native Doctor image
Gradle code : gradle.properties ,
gradle-wrapper.properties
Gradle Directory : Here
Path variables :Here
I appreciate all help (I think, that issue is in PATH, but not sure). By the way - does anyone know, how to add pictures without link?
You are confusing gradle with the gradle plugin.
The gradle plugin 6.4.1 doesn't exist.
Use the latest stable version:
classpath 'com.android.tools.build:gradle:4.2.2'
Check also the compatibility with the gradle version:
Plugin version Required Gradle version
4.0.0+ 6.1.1+
4.1.0+ 6.5+
4.2.0+ 6.7.1+
Long story short: My android phone keeps disconnecting from ADB. I was told to update android studio, did that. I open my project in Intellij and try to run on android and I get an error:
BUILD FAILED
Total time: 48.986 secs
Error: /Users/me/Desktop/comp/Development/comp-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> java.lang.NullPointerException (no error message)
My first thought is that my gradle is the wrong version. For this specific app, I need to use gradle version 2.14.1.
When I type gradle -v I'm getting version 3.3.
Is there a way to delete/downgrade gradle from 3.3 to 2.14.1?
Or is this another problem?
If you're using the gradle wrapper, then there'll be a folder in your project named "gradle" with a subfolder named "wrapper", inside that, there are 2 files:
- gradle-wrapper.jar
- gradle-wrapper.properties
Open "gradle-wrapper.properties" and change the place where it says "3.3" to "2.14.1". Then sync gradle, and it will automatically download 2.14.1.
If you're using the new 2.3 Android Studio, you HAVE to use gradle wrapper 3.3, as its the minimum supported gradle wrapper version. If so, then you'll have to download Android Studio 2.2, or fix whatever issue you have in your project that needs gradle wrapper version 2.14.1.
To get more information about whatever the issue is, try running this:
./gradlew clean assemble -stacktrace
That will clean your project, try and compile it, and if/when it fails, it will show you a stacktrace of the error.
What you should do is to change the gradle build tools version to the one that matches your gradle version. According to here you can set the gradle to 2.14.1 by changing build tools to lower than 1.0.0.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'// For gradle 2.2.1 - 2.3
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Notice: if you keep checking the mentioned link you'll see Higher is better for gradle.
For me, Android Studio > File > Invalidate Caches / Restart did the trick.
I got the same problem when upgrading to Android Studio 2.3.1. There is something funky about Gradle 3.3 (It fails by "java.lang.NullPointerException: null value in entry: destinationDir=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)").
Good news: seems like the current most recent version (3.5) works.
Go to File|Project Structure|Project, and use these versions:
Gradle version=3.5
Android Plugin version=2.3.1
I update the Android Studio version to 3.3 Canary 4, then update the gradle plugin, and the project stops working.
I do not know how to restore my AS to the previous state, nighter the gradle plugin.
But just with this command, the project now works, for me: gradlew clean assemble -stacktrace, in terminal tab in AS.
I'm trying to execute gradle wrapper for an Android project, and this error is raised:
A problem occurred evaluating root project 'myapp'.
> Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/dude/myapp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip
My wrapper task in build.gradle looks like this:
task wrapper(type: Wrapper) {
gradleVersion = "1.12"
}
I recently updated to Gradle v1.12 via Homebrew. Is it not supported or something? If so, where can I check this sort of thing?
A particular version of the Gradle Android plugin requires a particular version of Gradle (at least for now), and it seems that your version of the Gradle Android plugin requires Gradle 1.10. You might find more information on this in the documentation for the Gradle Android plugin.
PS: The wrapper task above creates the files necessary to run Gradle with the (generated) gradlew script, which is the preferred way to run Gradle (no manual install, every build can specify in its gradle-wrapper.properties which Gradle version it needs).
The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table hereļ¼
http://tools.android.com/tech-docs/new-build-system/version-compatibility
I had the same problem. It turned out that the old Android Studio created gradle related files one level above my application folder. In my case, the path was in ~/git/, and my project was at ~/git/myproject. I used Android Studio RC2 now, and no matter how I changed the config within the project, gradle still wanted to use the old 1.10 version. Therefore, I re-checked out the project a new path, and updated the gradle version reference within the project, then it compiled.