Android react本机fbsdk未编译';支持:appcompat-v7:25.0.0';
react本机版本0.51.0 react原生fbsdk版本0.6.3,我尝试了版本0.6.0 在安装react native fbsdk之前运行项目 我每走一步都在做 这是react原生fbsdk/build.gradleAndroid react本机fbsdk未编译';支持:appcompat-v7:25.0.0';,android,react-native,android-support-library,react-native-fbsdk,Android,React Native,Android Support Library,React Native Fbsdk,react本机版本0.51.0 react原生fbsdk版本0.6.3,我尝试了版本0.6.0 在安装react native fbsdk之前运行项目 我每走一步都在做 这是react原生fbsdk/build.gradle apply plugin: 'com.android.library' android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { minSd
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.facebook.react:react-native:+' // support react-native-v0.22-rc+
compile('com.facebook.android:facebook-android-sdk:4.+')
}
dependencies {
compile project(':react-native-fbsdk')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
这是app/build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.facebook.react:react-native:+' // support react-native-v0.22-rc+
compile('com.facebook.android:facebook-android-sdk:4.+')
}
dependencies {
compile project(':react-native-fbsdk')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
错误是
Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Error:Error:Failed to resolve: com.android.support:appcompat:25.0.0
Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Error:Error:line (19)Failed to resolve: com.android.support:appcompat:25.0.0
Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
我正在做这个变通方法,但我没有找到正确的方法来解决它 将此更改为
节点\u模块/react native fbsdk/android/build.gradle
:
//Before
dependencies {
...
compile('com.facebook.android:facebook-android-sdk:4+')
}
//After
dependencies {
...
compile('com.facebook.android:facebook-android-sdk:4.28.0')
}
也许对你也有帮助。React Native Project:转到
android/build.gradle
1.您所要做的就是为
maven.google.com
2.添加
resolutionStrategy
将有助于限制android:facebook-android-sdk:4.28.0
allprojects {
repositories {
mavenLocal()
jcenter()
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.28.0'
}
}
maven {
url "https://maven.google.com"
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
将build.gradle中的
com.android.support:appcompat
更改为
dependencies {
compile project(':react-native-fbsdk')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:27.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
尝试从您的android sdk管理器更新
支持库
。已安装最新版本