异常信息
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing.org.jetbrains.kotlin.gradle.internal.KaptExecution
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
刚刚更新到Mac上的Android Studio北极狐,在修复和更新所有Gradle设置以使其与Gradle 7.0和这个新版本需要做的任何事情兼容后,现在在构建项目时遇到了这个错误:
- 尝试通过使用命令行并执行"./gradlew clean build“来调试这个问题,下面是得到的输出:
> Configure project :app
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
> Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libc++_shared.so, libjniPdfium.so, libmodft2.so, libmodpdfium.so, libmodpng.so.
> Task :app:stripReleaseDebugSymbols
Unable to strip the following libraries, packaging them as they are: libc++_shared.so, libjniPdfium.so, libmodft2.so, libmodpdfium.so, libmodpng.so.
> Task :app:extractReleaseNativeSymbolTables
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips/libmodpng.so because unable to locate the objcopy executable for the mips ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips/libmodft2.so because unable to locate the objcopy executable for the mips ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips/libc++_shared.so because unable to locate the objcopy executable for the mips ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips/libmodpdfium.so because unable to locate the objcopy executable for the mips ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips/libjniPdfium.so because unable to locate the objcopy executable for the mips ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libmodpng.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libmodft2.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libc++_shared.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libmodpdfium.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libjniPdfium.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips64/libmodpng.so because unable to locate the objcopy executable for the mips64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips64/libmodft2.so because unable to locate the objcopy executable for the mips64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips64/libc++_shared.so because unable to locate the objcopy executable for the mips64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips64/libmodpdfium.so because unable to locate the objcopy executable for the mips64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/mips64/libjniPdfium.so because unable to locate the objcopy executable for the mips64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86/libmodpng.so because unable to locate the objcopy executable for the x86 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86/libmodft2.so because unable to locate the objcopy executable for the x86 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86/libc++_shared.so because unable to locate the objcopy executable for the x86 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86/libmodpdfium.so because unable to locate the objcopy executable for the x86 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86/libjniPdfium.so because unable to locate the objcopy executable for the x86 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libmodpng.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libmodft2.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libc++_shared.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libmodpdfium.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libjniPdfium.so because unable to locate the objcopy executable for the arm64-v8a ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libmodpng.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libmodft2.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libc++_shared.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libmodpdfium.so because unable to locate the objcopy executable for the x86_64 ABI.
Unable to extract native debug metadata from /Volumes/DocumentsNew/Users/fabrizio/AndroidStudioProjects/VSheetMusic/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libjniPdfium.so because unable to locate the objcopy executable for the x86_64 ABI.
> Task :app:kaptDebugKotlin FAILED
> Task :app:kaptReleaseKotlin FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app: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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:kaptReleaseKotlin'.
> 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.
==============================================================================
* 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 15s
69 actionable tasks: 68 executed, 1 up-to-date
解决
Mac M1遇到了同样的问题。问题来自于对空间的使用:
implementation "androidx.room:room-runtime:2.3.0"
kapt "org.xerial:sqlite-jdbc:3.34.0"
kapt "androidx.room:room-compiler:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
找到了一个解决方法:https://youtrack.jetbrains.com/issue/DBE-12342 必须在
build.gradle
中添加这个来添加JDBC驱动程序:
kapt "org.xerial:sqlite-jdbc:3.34.0"
网友评论