Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 30346

react native app crash by adding this line: apply plugin: 'com.google.gms.google-services'

$
0
0

In my react native app i had added firebase , so my root gradle and app gradle is:

root build.gradle:

buildscript {
ext {
   ...
}
repositories {
    google()       
    maven {
         url 'https://maven.fabric.io/public'
    }
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'
    classpath 'com.google.gms:google-services:4.0.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
    repositories {
       mavenLocal()
       google()        
       maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
       }
       jcenter()
   }
}

...

app build.gradle:

...
dependencies {
    ...
    implementation 'com.android.support:design:${rootProject.ext.supportLibVersion}'
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.google.firebase:firebase-core:16.0.1'

}


// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

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

When i run project , app crashed ; But when i comment this line:

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

app run correctly.

I was ruined , please help me :)


Viewing all articles
Browse latest Browse all 30346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>