How do I resolve the a build exception failure in Android Studio? - android

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

Related

Upgrading React Native app to Gradle 7.4 errors

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.

What is navigation.json in Android Studio 4.1?

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

No such property: variantManager

I have an issue on the compilation on vs code and on android studio:
The build view:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-ble-plx'.
> No such property: variantManager for class: com.android.build.gradle.LibraryPlugin
Thanks for your help :)
Android Gradle Pugin Version : 3.6.1
Gradle Version 5.6.4
Everything points to the gradle version.
I was using gradle 5.4.1 and everything was working good until I updated to 5.6.4. So downgrading seems to be the only solution ATM (as also indicated here https://github.com/Polidea/react-native-ble-plx/issues/630)

Not able to change distributionUrl for Gradle

I'm creating an Ionic App with Ionic 3 and I've integrated FCM plugin from here. And after that whenever I try to build a project, then it gives error
A problem occurred evaluating root project 'android'.
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in Project_path\gradle\wrapper\gradle-wrapper.properties to gradle-4.6-all.zip
So what I did is change the distributionUrl to https\://services.gradle.org/distributions/gradle-4.6-all.zip and build the project. After building the url automatically changes back to https\://services.gradle.org/distributions/gradle-4.1-all.zip.
What could be the solution or I'm heading in the wrong direction.

Failed to apply plugin

Error:(1, 1) A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.android.application']
Minimum supported Gradle version is 3.3. Current version is 2.14.1. If using the gradle wrapper, try editing the distributionUrl in /home/bitcode/Ameya_Workspace/ila/gradle/wrapper/gradle-wrapper.properties to gradle-3.3-all.zip
Here my gradle-wrapper.properties to gradle-3.3-all.zip is already present in application still I am getting this error
Isn't the error clear?
Minimum supported Gradle version is 3.3. Current version is 2.14.1.
Open Module Settings (your project) > Project > Gradle version and enter 3.3

Categories

Resources