gpt4 book ai didi

将项目SDK更改为android pie时Android Studio同步错误

转载 作者:行者123 更新时间:2023-11-30 05:09:50 25 4
gpt4 key购买 nike

我的项目同步时出现此错误:

Android resource linking failed
Output: C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1087: error: resource android:attr/fontVariationSettings not found.
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1088: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\Noahd\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\0eca6d6c39cae440624a131cc96c7f87\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\Noahd\AppData\Local\Android\Sdk\platforms\android-26\android.jar\
--manifest\
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
pro.bwac.randomizer\
-0\
apk\
--output-text-symbols\
C:\Users\Noahd\AndroidStudioProjects\randomizer\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

构建.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

为什么会这样?我的项目一直很好,直到我发现我的 android 手机在 Android Oreo 上,而我的项目是 Android Pie,所以我下载了 Oreo SDK 并更改了项目 min 和 target SDK。这破坏了一切,我无法运行它。

最佳答案

Why could this be? My project was fine up until I found that my android phone was on Android Oreo, and my project was Android Pie so I downloaded the Oreo SDK and changed the projects min and target SDK. And that broke everything and I can't run it.

看起来编译 sdk 版本和支持库版本不匹配。假设基于您上面提到的内容,因为您可能错过了更新与编译 sdk 版本匹配的支持库版本。

关于将项目SDK更改为android pie时Android Studio同步错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53926826/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com