React Native Android Generate Signed APK 给出资源错误 [英] React native Android Generate Signed APK giving Resource error

查看:58
本文介绍了React Native Android Generate Signed APK 给出资源错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have completed my android project on React Native and finding this error while compiling the project for 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 的版本问题,但无法弄清楚

These are the problems I am getting, these are about resources and I don't know how to resolve it. It seems like Version issue with targetSDK but can't figure out

推荐答案

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

Change supportLibVersion of build.gradle of your project to 27.1.1

编辑

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

How about adding below code to build.gradle of project,

subprojects {
  afterEvaluate {project ->
    if (project.hasProperty("android")) {
        android {
            compileSdkVersion 27
            buildToolsVersion "27.1.1"
        }
    }
  }
}

这篇关于React Native Android Generate Signed APK 给出资源错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆