Forked from nadesh-git/gist:908b9714f9c7f20b66dfb13b49ba346a
Created
November 6, 2019 09:00
-
-
Save tlandn/8a2e67980eb5a5299a2f3c445bfddc99 to your computer and use it in GitHub Desktop.
React native build issue - Androidx migration (June 2019)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Reference | |
| https://developer.android.com/jetpack/androidx/migrate | |
| android/build.gradle: | |
| ==================== | |
| buildscript { | |
| ext { | |
| googlePlayServicesVersion = "16.+" | |
| firebaseVersion = "17.3.4" | |
| } | |
| configurations.all { | |
| resolutionStrategy { | |
| force "com.google.android.gms:play-services-basement:16.0.1" | |
| force "com.google.android.gms:play-services-base:16.0.1" | |
| force "com.google.android.gms:play-services-stats:16.0.1" | |
| force "com.google.android.gms:play-services-gcm:16.0.0" | |
| } | |
| } | |
| build.gradle: | |
| ============ | |
| #Use following updated dependencies: | |
| dependencies { | |
| implementation "com.google.android.gms:play-services-base:16.0.1" | |
| implementation(project(":react-native-device-info"), { | |
| exclude group: "com.google.android.gms" | |
| }) | |
| implementation "com.google.android.gms:play-services-gcm:16.0.0" | |
| implementation "com.google.android.gms:play-services-analytics:16.0.8" | |
| // implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" | |
| implementation 'androidx.appcompat:appcompat:1.0.2' | |
| implementation "com.facebook.react:react-native:+" // From node_modules | |
| implementation "com.google.firebase:firebase-core:16.0.9" | |
| implementation "com.google.firebase:firebase-messaging:18.0.0" | |
| } | |
| gradle.properties: | |
| ================= | |
| android.enableJetifier=true | |
| android.useAndroidX=true | |
| package.json | |
| ============ | |
| #Need to update some dependency version | |
| "react-native": "0.59.9", | |
| "react-native-device-info": "2.1.2", | |
| "react-native-firebase": "^5.5.0", | |
| gradle-wrapper.properties | |
| ========================= | |
| distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip | |
| run this command: | |
| ================ | |
| npm i jetifier && npx jetify |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment