1

我已经在 React Native 上完成了我的 android 项目,并在为 Signed Apk 编译项目时发现了这个错误。

> Task :react-native-video:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/kedardave/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/e10f37597a16932be24db019d75c890a/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

/Users/kedardave/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/e10f37597a16932be24db019d75c890a/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

/Users/kedardave/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/e10f37597a16932be24db019d75c890a/res/values-v26/values-v26.xml:17:5-93:AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

/Users/kedardave/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/e10f37597a16932be24db019d75c890a/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.

/Users/kedardave/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/e10f37597a16932be24db019d75c890a/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/font not found.

/Users/kedardave/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/e10f37597a16932be24db019d75c890a/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.

error: failed linking references.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-keep-awake:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* 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 2m 42s
132 actionable tasks: 100 executed, 32 up-to-date

这些是我遇到的问题,这些是关于资源的,我不知道如何解决它。似乎是 targetSDK 的版本问题,但无法弄清楚

4

1 回答 1

1

将项目的 build.gradle 的 supportLibVersion 更改为 27.1.1

编辑

如何将以下代码添加到项目的 build.gradle 中,

subprojects {
  afterEvaluate {project ->
    if (project.hasProperty("android")) {
        android {
            compileSdkVersion 27
            buildToolsVersion "27.1.1"
        }
    }
  }
}
于 2018-11-22T19:41:59.217 回答