Error: Could not determine java version from '12' - android

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.

Related

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

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

Android Studio Error: During launch : com.android.build.gradle.internal.res.ResourceCompilerRunnable

Tried to launch my app and get this error. I'm going crazy with new gradle 8.
How can i fix it?
I've made this command:
./gradlew :MatchUp:dependencies --warning-mode all
And then these are answers:
Starting a Gradle Daemon, 3 incompatible and 3 stopped Daemons could not be reused, use --status for details
The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. JFrog announced JCenter's sunset in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.3.3/userguide/upgrading_version_6.html#jcenter_deprecation
at settings_1i0yjjkfvqy3y2on3vxaqibu6$_run_closure1$_closure2.doCall(/Users/cristiancapannini/Desktop/COLAN_WORKS/Android/MatchUp/settings.gradle:8)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
FAILURE: Build failed with an exception.
Where:
Build file '/Users/cristiancapannini/Desktop/COLAN_WORKS/Android/MatchUp/app/build.gradle' line: 2
What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
Your current JDK is located in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.
How can i fix it?
Obviously it needs to be fixed in order to still maintain the backward compatibility of the app. Thanks
with regard
Files gradle
https://drive.google.com/drive/folders/1YEFZI3W9Sn3p6urwHm2eK-Hx8wNHmJeC?usp=sharing
Cristian

Plugin intercom update to latest version cordova error at build/run

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

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)

Android Studio gives error: Gradle version 2.10 is required. Current version is 2.2.1 in Cordova project?

I have a Cordova/Phonegap application, every time when I rebuild the application using cordova build android it gives me below error.
ANDROID_HOME=/Users/name/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/name/Desktop/Ponet/zoomber/platforms/android/build.gradle' line: 22
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
> Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in /Users/name/Desktop/Ponet/zoomber/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.256 secs
Error: Error code 1 for command: /Users/name/Desktop/Ponet/zoomber/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/name/Desktop/Ponet/zoomber/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Recently I have updated my Android Studio 1.5 to 2.1 and imported previous project setting. Problem can be solved if I removed my android platform and add it again and rebuild the application. But this is very time consuming to do. Please provide any suggestions or solutions?
I tried below answers: (not Cordova specific)
Gradle version 2.10 is required. Current version is 2.8 Error
Thank you in-advance!
Edit the /Users/name/Desktop/Ponet/zoomber/gradle/wrapper/gradle-wrapper.properties file and set the distributionUrl property to
https\://services.gradle.org/distributions/gradle-2.14-all.zip
(current version at time of writing)

Categories

Resources