我無法在配備 M1 Pro 芯片的 MacBook Pro 上運行我的 Android Studio 專案,但它確實可以在配備英特爾芯片的 Windows 和 MacBook Pro 上運行。
這是我遇到的錯誤:
> Task :app:compileDebugJavaWithJavac FAILED
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.ExceptionInInitializerError
* 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.
Here is stacktrace result:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/User/Downloads/FindMeHomeApp-master 2/app/build.gradle'
* What went wrong:
Could not compile build file '/Users/User/Downloads/FindMeHomeApp-master 2/app/build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
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)
在這里,我有很多行開始于:
在 org.codehaus。
或在 groovy.lang。
或在 org.gradle。
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:833)
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.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
uj5u.com熱心網友回復:
回答我的問題
對于使用 M1 /M1 Pro 芯片的用戶,請使用 Room 2.4.0-alpha03。
def room_version = "2.4.0-alpha03"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/408695.html
標籤:
