拨开荷叶行,寻梦已然成。仙女莲花里,翩翩白鹭情。
IMG-LOGO
主页 文章列表 无法在带有M1Pro芯片的MacBook的androidstudio中运行我的项目

无法在带有M1Pro芯片的MacBook的androidstudio中运行我的项目

白鹭 - 2022-01-24 2112 0 2

我无法在配备 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"
标签:

0 评论

发表评论

您的电子邮件地址不会被公开。 必填的字段已做标记 *