我必须删除并重新安装node-modules
文件以解决其他问题,然后使用yarn install
命令重新安装了模块。当我这样做的时候,我就崩溃了
C:\Users\Jacob\kalleo\kalleo-master\kalleo-native\android\app\src\main\AndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:24:3-97:17 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:24:3-97:17 to override.
我尝试了建议的修复方法,尝试将'tools:replace'行添加到清单中,包括适当的xmlns url。我还尝试将模块重新链接到android studio。
这是我的应用文件中的相关部分。
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "com.kalleonative"
minSdkVersion 16
targetSdkVersion 26
versionCode 10
versionName "1.1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
...
dependencies {
compile project(':react-native-contacts')
compile project(':react-native-vector-icons')
compile project(':react-native-firebase-analytics')
compile project(':react-native-fbsdk')
compile project(':react-native-push-notification')
compile ('com.google.android.gms:play-services-gcm:10.0.1') {
force = true
}
compile project(':react-native-config')
compile fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
compile "com.facebook.react:react-native:0.46.4" // From node_module
compile 'com.twilio:voice-android:2.0.0-beta14'
//noinspection GradleCompatible
compile 'com.android.support:design:28.0.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.koushikdutta.ion:ion:2.2.1'
compile 'com.google.firebase:firebase-messaging:19.0.1'
compile 'com.segment.analytics.android:analytics:4.4.0-beta1'
compile project(':react-native-immediate-phone-call')
}
我不确定是什么原因导致了崩溃。
答案 0 :(得分:0)
该错误是由于依赖关系冲突引起的。将这两行添加到gradle.properties文件中,希望它将解决该问题
android.useAndroidX=true
android.enableJetifier=true