Android Arctic Fox 的 InvokingTargetException 2020.3.1 M1 苹果芯片上的arm64

han*_*ach 3 android arm64 kapt apple-silicon apple-m1

kapt在我的 M1 Apple Silicon 上使用(例如 Room)构建 Android 项目期间

Android Studio Arctic Fox | 2020.3.1 Beta 1 arm64
..
Android Studio Arctic Fox | 2020.3.1 Beta 5 arm64
Android Studio Bumblebee | 2021.1.1 Canary 2 aarch64
Run Code Online (Sandbox Code Playgroud)

Android Studio Arctic Fox | 2020.3.1 Beta 5
Build #AI-203.7717.56.2031.7360992, built on May 14, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.4
Run Code Online (Sandbox Code Playgroud)

我遇到

Execution failed for task ':FFTSpectrumLib:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
   > java.lang.reflect.InvocationTargetException (no error message)

* 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.
Run Code Online (Sandbox Code Playgroud)

我不知道如何让它与快速 aarch64 一起工作!

对于x86来说它可以工作

Android Studio Arctic Fox | 2020.3.1 Beta 1 x86
Run Code Online (Sandbox Code Playgroud)

han*_*ach 14

根本原因是 Room2.3.0 这个https://github.com/xerial/sqlite-jdbc/issues/450向我指出了解决方案

方案A

添加

kapt "org.xerial:sqlite-jdbc:3.34.0"

它包括这个https://github.com/xerial/sqlite-jdbc/releases/tag/3.32.3.3

方案B

只需使用房间2.4.0-alpha03