gpt4 book ai didi

android - list 合并失败。添加并链接 react-native-device-info 后

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:17:52 26 4
gpt4 key购买 nike

list 合并失败:来自 [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24 的属性元数据#android.support.VERSION@value value=(26.0.1) :9-31也存在于 [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0)。建议:在 AndroidManifest.xml:26:9-28:38 处的元素中添加 'tools:replace="android:value"' 以进行覆盖。

RN v0.55

react-native-device-info v0.21.5

app/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>

react-native-device-info/android/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"
}

最佳答案

查看依赖的react-native-xxxx模块的build.gradle,更改依赖的gmsfirebase 库的版本相同。

依赖于您的应用gms库的版本目前是11.8.0,因此将其他所有内容更改为 11.8.0

检查所有模块以查看 gmsfirebase 的版本。

在某些情况下,您可能需要更改 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"
}

关于android - list 合并失败。添加并链接 react-native-device-info 后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50504370/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com