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)
Related
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+
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
I want to update plugin intercom to latest version. I am using cordova version 9.0.0
For iOS works fine, but to update intercom for android I must have the version of platform >= 9.0.0
I updated from version 7.1.1 to 9.0.0 (android platform), but I got 2 errors. I think that is gradle cause these errors... Because I tried to make another fresh cordova project to see if everything works fine... but application does not run/build.
The text of errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Script '..\platforms\android\cordova-plugin-intercom\be-intercom.gradle' line: 46
What went wrong:
A problem occurred evaluating script.
Could not find method execute() for arguments [] on task ':app:copyGoogleServices' of type org.gradle.api.tasks.Copy.
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
compileSdkVersion is not specified. Please add it to build.gradle
I have google-services.json (in root).
Everything works fine before this update.
In ..\platforms\android\cordova-plugin-intercom\be-intercom.gradle at line 46 is tasks.copyGoogleServices.execute().
The solution is to replace the execute() with finalizedBy() in platforms\android\cordova-plugin-intercom\be-intercom.gradle and to copy google-services.json in platforms\android\app.
https://medium.com/#olku/gradle-5-0-broken-api-of-the-exec-task-5b2d76c8d121
How to fix the following android build issue
FAILURE: Build failed with an exception.
What went wrong: Could not determine java version from '12'.
Change gradle wrapper distributionUrl version to latest i.e in my case I replaced distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip with distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip.