Ale*_*ini 10 android-gradle-plugin react-native react-native-fbsdk
在我的android/app/build.gradle中的 react-native项目中,我有
...
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "..."
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
...
dependencies {
compile project(':react-native-fbsdk')
compile project(':react-native-vector-icons')
compile project(':react-native-splash-screen')
compile project(':react-native-spinkit')
compile project(':react-native-orientation')
compile project(':react-native-maps')
compile project(':react-native-android-sms-listener')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26+"
compile "com.android.support:design:26+"
compile "com.android.support:recyclerview-v7:26+"
compile "com.android.support:cardview-v7:26+"
compile "com.facebook.react:react-native:+" // From node_modules
compile("com.crashlytics.sdk.android:crashlytics:2.8.0@aar") {
transitive = true;
}
}
...
Run Code Online (Sandbox Code Playgroud)
但我总是得到
<mypath> .../node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
<mypath> .../node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
:react-native-fbsdk:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fbsdk:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Run Code Online (Sandbox Code Playgroud)
Sye*_*Ali 38
转到React-Native Project:android/build.gradlefile并将fbsdkVersion 限制为4.28.0.
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
如果您有其他错误,如下所示:
检索项目的父项时出错:找不到与给定名称"android:TextAppearance.Material.Widget.Button.Colored"匹配的资源.
你可以试试:
allprojects {
repositories {
...
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.22.1'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
资料来源:rafaesc
你去YOUR_PROJECT/node_modules/react-native-fbsdk/android/build.gradle
寻找第19行:
dependencies {
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.facebook.react:react-native:+' // support react-native-v0.22-rc+
compile('com.facebook.android:facebook-android-sdk:4.+')
}
Run Code Online (Sandbox Code Playgroud)
改变编译('com.facebook.android:facebook-android-sdk:4+')编译('com.facebook.android:facebook-android-sdk:4.28.0')
它对我有用
| 归档时间: |
|
| 查看次数: |
8197 次 |
| 最近记录: |