Nubescope/react-native-facebook-account-kit

Can not use with react native firebase starter project

tuan072090 opened this issue ยท 3 comments

My project is initialized from react native firebase starter project here

It work fine on iOS but on android.

First, android studio cannot synsc the project because of conflits google play service version. I manualy changed the versions in react-native-account-kit grade file as below

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-auth-base:15.0.1"
implementation "com.google.android.gms:play-services-auth-api-phone:15.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.android.support:appcompat-v7:${SUPPORT_LIB_VERSION}"
implementation "com.android.support:design:${SUPPORT_LIB_VERSION}"
implementation ("com.facebook.android:account-kit-sdk:${ACCOUNT_KIT_VERSION}"){
exclude group: 'com.parse.bolts', module: 'bolts-android';
exclude group: 'com.parse.bolts', module: 'bolts-applinks';
exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}

}

Then the project is synced successfully, but build failed and get the error "org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
"
this is the error screenshot
https://gyazo.com/6cddb606659a9160c4c4879109bb9710

I spent 2 days to debug but cannot fix it. please safe my life :((((

Hi @tuan072090

I tried what you mentioned with the latest react-native-firebase-starter and worked by doing the following steps:

  1. Update the react-native-firebase-starter/android/build.gradle file and added de configurations.all node to force dependencies (no need to modify react-native-facebook-account-kit lib)
allprojects {
    repositories {
        mavenLocal()
        jcenter()
        google()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }

        configurations.all {
            resolutionStrategy {
                force "com.android.support:appcompat-v7:27.1.1"
                force "com.android.support:support-v4:27.1.1"
                force "com.google.android.gms:play-services-base:15.0.1"
                force "com.google.android.gms:play-services-auth-base:15.0.1"
                force "com.google.android.gms:play-services-auth-api-phone:15.0.1"
                force "com.google.android.gms:play-services-auth:15.0.1"
            }
        }
    }
}
  1. Update the react-native-firebase-starter/android/app/src/name/AndroidManifest.xml file to override the allowBackup option:

Notice the new xmlns:tools prop in the manifest node and the android:allowBackup prop in the application node

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.invertase.rnfirebasestarter"
    android:versionCode="1"
    xmlns:tools="http://schemas.android.com/tools"
    android:versionName="1.0">

    <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      tools:replace="android:allowBackup"
      android:theme="@style/AppTheme">

That's it! feel free to reopen the issue if you are still having issues!

@jpgarcia thank you so much, it worked perfectly ๐Ÿ’ƒ

Hello, I am using RN 57.5 and react-native-facebook-account-kit 1.1.0. the build was successful but app cannot start by saying "Unfortunately, app has stopped". I have tried the steps mentioned above and issue #159 but still cannot get the app running. iOS is running fine. The issue is only on Android.

[Update]
I have found the issue when I check the log from android. Facebook account kit needs App Name in the AndroidManifest file and I thought it is optional :D . Once it is set up, it is working beautifully.

Is there anyway I can change the texts in the phone number page, code key in page? Thanks!