首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android:未找到attr/fontStyle

android:未找到attr/fontStyle
EN

Stack Overflow用户
提问于 2020-10-28 17:42:10
回答 1查看 558关注 0票数 0

当我在我的react android项目上运行./gradlew assembleRelease时,我一直收到以下错误:

代码语言:javascript
复制
    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /root/.gradle/caches/transforms-2/files-2.1/6da249295a8c8ecbd4d1ab0ef0c0da5a/core-1.5.0-alpha04/res/values/values.xml:143:5-174:25: AAPT: error: resource android:attr/fontStyle not found.
         
     /root/.gradle/caches/transforms-2/files-2.1/6da249295a8c8ecbd4d1ab0ef0c0da5a/core-1.5.0-alpha04/res/values/values.xml:143:5-174:25: AAPT: error: resource android:attr/font not found.
         
     /root/.gradle/caches/transforms-2/files-2.1/6da249295a8c8ecbd4d1ab0ef0c0da5a/core-1.5.0-alpha04/res/values/values.xml:143:5-174:25: AAPT: error: resource android:attr/fontWeight not found.
         
     /root/.gradle/caches/transforms-2/files-2.1/6da249295a8c8ecbd4d1ab0ef0c0da5a/core-1.5.0-alpha04/res/values/values.xml:143:5-174:25: AAPT: error: resource android:attr/fontVariationSettings not found.
         
     /root/.gradle/caches/transforms-2/files-2.1/6da249295a8c8ecbd4d1ab0ef0c0da5a/core-1.5.0-alpha04/res/values/values.xml:143:5-174:25: AAPT: error: resource android:attr/ttcIndex not found.

它构建得很好,我做了一个assembeDebug

下面是我的一些gradle构建设置

代码语言:javascript
复制
 buildToolsVersion = "29.0.2"
        minSdkVersion = 16
        compileSdkVersion = 29
        targetSdkVersion = 29
        ext.kotlin_version = '1.4.10'


multiDexEnabled true


release {
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }


apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
buildscript {
    ext.kotlin_version = '1.4.10'
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
repositories {
    mavenCentral()
}
EN

回答 1

Stack Overflow用户

发布于 2020-10-28 18:42:49

运行以下命令:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res --verbose

然后删除project_root/android/app/src/main/raw + drawable-..文件夹。

在此之后,构建您的发布APK。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64570160

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档