Today, I face the error mentioned in this post: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'

有趣的是(和区别在于)——我们的应用程序已经投入生产5个月了,到目前为止,我们已经进行了数百次构建和APK.

Execution failed for task ':react-native-fbsdk:processReleaseResources'

X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.    
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.    
X:\app\node_modules\react-native-fbsdk\android\build\intermediates\res\merged\release\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

使用以下版本的库(package.json):

...
"react": "15.3.2",
"react-native": "0.37.0",
...
"react-native-fbsdk": "~0.5.0",
...

我们的身材.gradle(不完整),迄今为止一直有效:

    compileSdkVersion 24
    buildToolsVersion '24.0.3'
    defaultConfig {
        applicationId "xxx"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 14
        versionName "1.5.3"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

dependencies {
    compile project(':react-native-device-info')
    compile project(':react-native-maps')
    compile project(':realm')
    compile project(':react-native-vector-icons')
    compile project(':react-native-image-picker')
    compile project(':react-native-fs')
    compile project(':react-native-share')
    compile project(':react-native-push-notification')
    compile project(':react-native-fbsdk')
    compile('com.google.android.gms:play-services-gcm:9.4.0') {
        force = true;
    }
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.facebook.react:react-native:+'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
    compile 'com.fasterxml.jackson.core:jackson-core:2.2.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
}

有什么 idea 吗?

推荐答案

我终于找到了解决办法.在阅读了所有答案和相关问题(Facebook Sdk Android Error Building)并try 了许多事情(库更新、依赖项、大量版本更改等)后,我再次成功构建了我的应用程序.然后我恢复了所有不必要的更改,剩下的是:

I needed to add 2 things (iterator and line with "force") in my android/build.gradle file(不是android/app/build.gradle):

allprojects {
    configurations.all {
       resolutionStrategy {
         eachDependency { DependencyResolveDetails details ->
           if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
             details.useVersion "0.37.0" // Your real React Native version here
           }
         }
         force 'com.facebook.android:facebook-android-sdk:4.22.1'
       }
    }
}

不管怎样,谢谢你的建议!

React-native相关问答推荐

错误:HostBody::get for prop NativeUnimoduleProxy中出现异常- Android虚拟设备(AVD)使用Expo测试React Native App时崩溃

为什么我的expoav视频不会自动播放?

每当我在 React Native Tab Navigator 中切换标签时触发 UseEffect

React Native - 如何在从另一个屏幕导航后将 ScrollView 滚动到给定位置

React-Native:无法从我的 android 应用程序打开设备设置

React中类似于 React Native 中的 FlatList

如何以编程方式在 react-native 中截屏

如何将抖动动画添加到视图(react-native)?

xcrun:错误:SDK "iphoneos" cannot be located

React-Native Android 中隐藏(hide)的元素溢出

在 React Native 中仅显示第一行文本

如何渲染多行文本组件,行间有白色间隙

如何从 React Native-App 中的 res/drawable-folder 加载图像?

React native Redux - 对象不是构造函数(判断'new ctor(props context)')

如何知道 FlatList 中的滚动状态?

键盘上方的 React Native 完成按钮

在 ReactNative 中单击按钮时如何获取 TextInput 中的值

React-native Awesome 元素没有构建 android 元素

如何将 jest 测试移动到 /test 文件夹并让它们运行?

React Native 构建命令失败:PhaseScriptExecution ... (domain=NSPOSIXErrorDomain, code=2)