清单合并失败:[com.android.support:cardview-v7:25.3.1] AndroidManifest.xml中的属性meta-data#android.support.VERSION@value value =(26.0.1):24 :9-31 也出现在[com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value =(26.1.0)。 建议:添加'工具:replace =" android:value"'到AndroidManifest.xml中的元素:26:9-28:38以覆盖。
RN v0.55
react-native-device-info v0.21.5
应用/的build.gradle:
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.myapp"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
}
dependencies {
compile project(':react-native-device-info')
compile project(':react-native-splash-screen')
compile(project(":react-native-google-sign-in")) { //ForGoogleSignIn
exclude group: "com.google.android.gms"
}
compile project(':react-native-fbsdk-corrected')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.0.1"
compile "com.facebook.android:facebook-android-sdk:4.28.0"
compile "com.facebook.react:react-native:+"
compile "com.google.android.gms:play-services-auth:11.8.0"
}
AndroidMenifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp" xmlns:tools="http://schemas.android.com/tools"
>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:exported="true">
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
</application>
</manifest>
反应本地设备-方式/机器人/的build.gradle
apply plugin: 'com.android.library'
def DEFAULT_COMPILE_SDK_VERSION = 23
def DEFAULT_BUILD_TOOLS_VERSION = "25.0.2"
def DEFAULT_TARGET_SDK_VERSION = 22
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "+"
android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion project.hasProperty('buildToolsVersion') ? project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 16
targetSdkVersion project.hasProperty('targetSdkVersion') ? project.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 2
versionName "1.1"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
lintOptions {
warning 'InvalidPackage'
}
}
dependencies {
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
compile 'com.facebook.react:react-native:+'
compile "com.google.android.gms:play-services-gcm:$googlePlayServicesVersion"
}
答案 0 :(得分:1)
检查从属build.gradle
模块的react-native-xxxx
,并将相关的gms
和firebase
库的版本更改为相同的版本。
依赖于gms
app
的{{1}}库的版本目前为11.8.0
,因此将其他所有内容更改为11.8.0
。
检查所有模块,查看gms
和firebase
的版本。
在某些情况下,您可能需要更改react-native-device-info
模块的sdk版本。由于案例很多,请先写下我的设置。
应用程序/的build.gradle:
dependencies {
// ...
// gms version is 11.8.0
compile "com.google.android.gms:play-services-auth:11.8.0"
}
react-native-device-info / build.gradle :(这是我的设置..)
buildscript {
// set up the same version
ext.firebaseVersion = '11.8.0'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 2
versionName "1.1"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
lintOptions {
abortOnError false
warning 'InvalidPackage'
}
}
dependencies {
compile 'com.facebook.react:react-native:+'
compile "com.google.android.gms:play-services-gcm:$firebaseVersion"
compile "com.google.firebase:firebase-core:$firebaseVersion"
compile "com.google.firebase:firebase-config:$firebaseVersion"
compile "com.google.firebase:firebase-auth:$firebaseVersion"
compile "com.google.firebase:firebase-database:$firebaseVersion"
compile "com.google.firebase:firebase-storage:$firebaseVersion"
compile "com.google.firebase:firebase-messaging:$firebaseVersion"
compile "com.google.firebase:firebase-crash:$firebaseVersion"
compile "com.google.firebase:firebase-perf:$firebaseVersion"
compile "com.google.firebase:firebase-ads:$firebaseVersion"
compile "com.google.firebase:firebase-firestore:$firebaseVersion"
compile "com.google.firebase:firebase-invites:$firebaseVersion"
}
答案 1 :(得分:0)
将tools:replace="android:value"
添加到应用标记上的清单中,例如
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@style/AppTheme"
tools:replace="android:value"
>