Closed ydv0121 closed 5 years ago
In my case problem was produced by
react-native-push-notification
package (https://github.com/zo0r/react-native-push-notification/blob/master/android/build.gradle#L50).It has
com.google.firebase:firebase-messaging
as dependency and it was upgraded from18.0.0 -> 19.0.0
. What producedadroidx
injection as dependency.Solution: add
firebaseVersion=18.0.0
to yourgradle.properties
thanks to @igordevelops i used similar solution. In android level build.gradle file (not which is inside app folder) i added these two lines:
buildscript { ext { buildToolsVersion = "28.0.2" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 27 supportLibVersion = "28.0.0"
those resolved the dependency error and my app works. might help someone. I got this manifest merger error as i used react-native-push-notification package.
Issue fixed by using the installed latest version of react-native-google-signin and react-native push-notification and below configuration : ext{ googlePlayServicesAuthVersion = "15.0.1" googlePlayServicesVersion = "16.1.0" firebaseVersion = "17.5.0" }
i solved mine with these dependencies
implementation project(':react-native-firebase') implementation(project(':react-native-push-notification')) { exclude group: 'com.google.android.gms' } implementation ("com.google.android.gms:play-services-gcm:16.1.0") { force = true } implementation ("com.google.android.gms:play-services-base:16.1.0") { force = true } implementation ("com.google.firebase:firebase-core:16.0.9") { force = true } implementation ("com.google.firebase:firebase-messaging:18.0.0") { force = true }
@firehand33 thanks BRO!!!finally build success
@JetCyC Thanks for the solution, it works for me.
Thanks for this. It worked like charm.
I recently made an article to address this AndroidX situation, you may find it useful.
you can force google play service version in
android> build.gradle
file inext
like followingext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" googlePlayServicesVersion = "16.0.0" googlePlayServicesVisionVersion = "17.0.2" }
my issue fixed :)
Thanks, wrote an article on this!! : https://medium.com/@zsubzwary/application-appcomponentfactory-issue-in-reactnative-project-possible-solution-3bc8afa97be?sk=201ea2c810de2c9199804aac06e17153
Thanks, @Yathousen for the article that I cannot read because it isn't free to read !!
Thanks, @Yathousen for the article that I cannot read because it isn't free to read !!
ðŸ˜ðŸ˜ðŸ˜“😓ðŸ˜ðŸ˜
Hi @zsubzwary, I'm sorry but that's weird, I'm not even part of the partner's program, are you sure you cannot read it? Could you share with us a screenshot?
Hi @zsubzwary, I'm sorry but that's weird, I'm not even part of the partner's program, are you sure you cannot read it? Could you share with us a screenshot?
@Yathousen here you go...
- Check if you have a library which depends on AndroidX:
cd android && ./gradlew app:dependencies
- For me it was Google Play Services @ 18.0.0 which depends on AndroidX.
- Set Google Play Services to specific version number (check https://developers.google.com/android/guides/releases for the version you want to use):
implementation "com.google.android.gms:play-services-maps:16.0.0"
- If a package uses a newer version (see 1.) of the Google Play Services libraries, just exclude it in your app's
build.gradle
:implementation(project(':react-native-maps')) { exclude group: 'com.google.android.gms', module: 'play-services-base' exclude group: 'com.google.android.gms', module: 'play-services-maps' }
- Add attributes to
<application>
in yourAndroidManifest.xml
:android:appComponentFactory="androidx" tools:replace="android:appComponentFactory"
- Add config to
settings.gradle
:android.useAndroidX=false android.enableJetifier=false
I'm not too sure about 4. and 5. but it's working for me like this. Be sure to revert this stuff when you update to 0.60+ and AndroidX support is provided by all libraries you use.
As mentioned by @firehand33 it could be that you have to force the Google Play Services libraries versions, e.g.:
implementation ("com.google.android.gms:play-services-gcm:16.1.0") { force = true }
Could you post your output when you executes step 1?
buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" googlePlayServicesVersion = "16.0.0" googlePlayServicesVisionVersion = "17.0.2"
got this error today to add the tools:replace in my mainfest
when i add tools:replace="android:appComponentFactory" to my mainfest file got another error -
don't understand how to resolve this?