Voj*_*ala 14 android android-gradle-plugin react-native react-native-fbsdk
今天,我面对这篇文章中提到的错误: 检索项目的父项时出错:找不到与给定名称匹配的资源'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'.
Run Code Online (Sandbox Code Playgroud)
使用这些版本的库(package.json):
...
"react": "15.3.2",
"react-native": "0.37.0",
...
"react-native-fbsdk": "~0.5.0",
...
Run Code Online (Sandbox Code Playgroud)
我们的build.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'
}
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
aFe*_*rer 14
我认为这与Facebook Sdk Android Error Building的问题相同
你必须改变
compile('com.facebook.android:facebook-android-sdk:4.+')
Run Code Online (Sandbox Code Playgroud)
至
compile('com.facebook.android:facebook-android-sdk:4.22.1')
Run Code Online (Sandbox Code Playgroud)
在node_modules\react-native-fbsdk\android\build.gradle中
最后我找到了解决方案.在阅读了所有答案和相关问题(Facebook Sdk Android错误构建)并尝试了许多事情(库更新,依赖关系,大量版本更改等)后,我设法再次构建我的应用程序.然后我恢复了所有不必要的更改,剩下的就是:
我需要在我的android/build.gradle文件中添加2个东西(迭代器和带有"force"的行)(不是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'
}
}
}
Run Code Online (Sandbox Code Playgroud)
无论如何,谢谢你的所有提示!
| 归档时间: |
|
| 查看次数: |
13454 次 |
| 最近记录: |