Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
React native build issue - Androidx migration (June 2019)
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
You can’t perform that action at this time.