我正在尝试在 android 工作室上制作我的第一个颤振项目,但我不断收到此错误。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
AAPT: error: failed to open APK: Invalid 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 6m 9s
Finished with error: Gradle task assembleDebug failed with exit code 1
我尝试使用vs代码,但收到了相同的错误。
注意:我的 gradle.properties 文件在 Android Studio 中看起来像这样
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
这个帮助会很棒,因为我已经尝试解决 2 天了。 谢谢
通过转到
android > app > build.gradle
改变
compileSdkVersion 28
targetSdkVersion 28
自
compileSdkVersion 29
targetSdkVersion 29