facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

Build Failed after install react-native-fbsdk #619

Closed crosskpixel closed 4 years ago

crosskpixel commented 5 years ago

I did the procedures described in the document https://rnfirebase.io/docs/v5.x.x/auth/social-auth

after installing react-native-fbsdk I came across the following errors

* What went wrong:
Execution failed for task ':react-native-firebase:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

follow below my settings

'app/gradle.properties'

apply plugin: "com.android.application"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: 'io.fabric'

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js",

    bundleInDebug: project.hasProperty("bundleInDebug") ? project.getProperty("bundleInDebug") : false,
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.invertase.rnfirebasestarter"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"

        // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
        multiDexEnabled true
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation project(':react-native-fbsdk')
    implementation project(':@react-native-community_async-storage')
    implementation project(':react-native-google-signin')
    implementation project(':react-native-firebase')
    implementation fileTree(dir: "libs", include: ["*.jar"])  
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation project(path: ':react-native-firebase')

    implementation "com.google.firebase:firebase-core:16.0.9"
    implementation "com.google.android.gms:play-services-base:16.1.0"

    implementation('com.google.firebase:firebase-ads:15.0.1') {
      exclude group: 'com.android.support', module: 'customtabs'
    }

    // Authentication
    implementation "com.google.firebase:firebase-auth:17.0.0"
    // Analytics
    implementation "com.google.firebase:firebase-analytics:16.5.0"
    // Performance Monitoring
    implementation "com.google.firebase:firebase-perf:17.0.0"
    // Remote Config
    implementation "com.google.firebase:firebase-config:17.0.0"
    // Cloud Storage
    implementation "com.google.firebase:firebase-storage:17.0.0"
    // Dynamic Links
    implementation "com.google.firebase:firebase-dynamic-links:17.0.0"
    // Real-time Database
    implementation "com.google.firebase:firebase-database:17.0.0"
    // Cloud Functions
    implementation "com.google.firebase:firebase-functions:17.0.0"
    // Cloud Firestore
    implementation "com.google.firebase:firebase-firestore:19.0.2"
    // Cloud Messaging / FCM
    implementation "com.google.firebase:firebase-messaging:18.0.0"
    // Crashlytics
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        transitive = true
    }

    implementation "com.android.support:multidex:1.0.3"

    implementation "com.android.support:customtabs:27.1.1"

    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'

'android/gradle.propeties'

buildscript {
    ext {
        googlePlayServicesVersion = "16.1.0"
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
        maven {
          url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
      classpath 'com.android.tools.build:gradle:3.4.1'
      classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:perf-plugin:1.2.1'
        classpath 'io.fabric.tools:gradle:1.28.1'
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}
kscc25 commented 4 years ago

Hi @crosskpixel , I'm getting the same issue with this, can you share how you deal with the problem? Thanks so much.