Launching lib\main.dart on M2006C3MII in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\Rana\Desktop\Flutter Projects\new_soft\android\build.gradle' line: 26
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file 'C:\Users\Rana\Desktop\Flutter Projects\new_soft\android\app\build.gradle' (C:\Users\Rana.gradle\caches\7.5\scripts\52edrvulxtnk4ivgfae602cyx).
> BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 63
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
Post your project build gradle codes in question
This error message is indicating that there is a compatibility issue between the version of the Java compiler being used to build the project and the version of the compiled class files. The error message specifically mentions that the "major version 63" of the class file is not supported by the compiler.
The major version numbers of Java class files follow a release-versioning scheme. In this case, "63" likely corresponds to Java SE 11 (18.9), while the compiler being used may not support that version.
To resolve this issue, you may need to update the compiler to a version that supports the class file major version, or alternatively, you can try to recompile the class files with a compatible version of the Java compiler.
This answer can help you open it
Related
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\gacna\AppData\Local\Android\Sdk (DEPRECATED)
(node:5840) [DEP0128] DeprecationWarning: Invalid 'main' field in 'C:\Pandora\PROD\Mobile\WebApp.Cordova\node_modules\objectorarray\package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use node --trace-deprecation ... to show where the warning was created)
Using Android SDK: C:\Users\gacna\AppData\Local\Android\Sdk
Reading build config file: C:\Pandora\PROD\Mobile\WebApp.Cordova\build.json
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Pandora\PROD\Mobile\WebApp.Cordova\platforms\android\app\build.gradle' line: 62
What went wrong:
A problem occurred evaluating project ':app'.
Could not find method compile() for arguments [com.android.support:support-v4:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
Command failed with exit code 1: C:\Pandora\PROD\Mobile\WebApp.Cordova\platforms\android\gradlew cdvBuildDebug -b C:\Pandora\PROD\Mobile\WebApp.Cordova\platforms\android\build.gradle
Trying to run cordova run on android studio.
You need to replace compile with implementation. This issue occurs from cordova-android 11 and up. For me, it was the qr-scanner plugin that gave this error. You can patch it with patch package.
cordova-android-11 docs (this issue is referenced in the comments): https://cordova.apache.org/announcements/2022/07/12/cordova-android-release-11.0.0.html
patch package: https://www.npmjs.com/package/patch-package
I am trying to compile an IONIC app using android studio and I get this error message. Could anyone please give me some advice how to sort this out?
where to look after this issue and how to resolve it.
Many thanks
FAILURE: Build failed with an exception.
Where: Settings file ‘C:\Users\Samsung PC\Desktop\user\platforms\android\settings.gradle’
What went wrong: Could not compile settings file ‘C:\Users\Samsung PC\Desktop\user\platforms\android\settings.gradle’. > startup failed: General error during conversion: Unsupported class file major version 62
java.lang.IllegalArgumentException: Unsupported class file major version 62
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:189)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:170)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:156)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:277)
at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
Command failed with exit code 1: C:\Users\Samsung PC\Desktop\user\platforms\android\gradlew :app:bundleRelease -b C:\Users\Samsung PC\Desktop\user\pl
atforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
What went wrong:
A problem occurred evaluating project ':app'.
Cannot convert URL 'C:/Users/HP/key.jks' to a file.[The plugin ext_storage uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
FAILURE: Build failed with an exception.
Where:
Build file '/Users/rajeevyadav/Downloads/sevendaystraventure/android/app/build.gradle' line: 58
What went wrong:
A problem occurred evaluating project ':app'.
Cannot convert URL 'C:/Users/HP/key.jks' to a file.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
]1
make sure that the key.jks file is in the correct directory
i'm using ionic project with angular
when I write ionic capacitor add android
I get this error message
Error running gradle sync
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file '/Users/macbookshop/Desktop/rp/android/app/build.gradle' (/Users/macbookshop/.gradle/caches/7.0/scripts/ay3p
wbb15u1).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 61
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
Unable to infer default Android SDK settings. This is fine, just run npx cap open android and import and sync gradle manually
✔ Syncing Gradle in 2.21s
[success] android platform added!
Follow the Developer Workflow guide to get building:
https://capacitorjs.com/docs/basics/workflow
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\romit\Desktop\FlutterSoft\projects\basic_app\android\build.gradle' line: 26
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not open proj generic class cache for build file 'C:\Users\romit\Desktop\FlutterSoft\projects\basic_app\android\app\build.gradle' (C:\Users\romit.gradle\caches\6.7.1\scripts\4hhqko2lgng4etjv4i11vmj58).
> BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
NOTE: I have already updated the gradle. Also tried solving it by using gradlew clean and gradlew build.
DOES ANYONE HAVE SOLUTION FOR THIS?
///build.gradle snippets
Code LINE -1-27
Remaining Lines
Major Version 60 is for Java 16 - see https://en.wikipedia.org/wiki/Java_class_file#General_layout.
As far as I know Android does not support this java version at all. Also it seems Android Studio does only support Java 7 (full) and Java 8 (partial) - see https://developer.android.com/studio/write/java8-support.
Android Gradle plugin 3.0.0 and later support all Java 7 language
features and a subset of Java 8 language features that vary by
platform version. When building your app using Android Gradle plugin
4.0.0 and higher, you can use a number of Java 8 language APIs without requiring a minimum API level for your app.
I am using Eclipse most time, but I think the settings can be done as described at
https://developer.android.com/studio/intro/studio-config#jdk