Good day! I need to connect firebase-messaging to my application, I implement everything as written in the documentation

And according to this lesson

When checking for a connection, I get this message

Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync. 

I synchronized, I reassembled and checked all dependencies, but for some reason the problem is not solved.

In gradle

 android { compileSdkVersion 25 buildToolsVersion "25.0.1" defaultConfig { applicationId "com.runtest.aplication" minSdkVersion 12 targetSdkVersion 25 versionCode 16 versionName "2" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } buildTypes { debug { debuggable false } } } dexOptions { incremental true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } 

and here

  dependencies { // compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:gridlayout-v7:25.0.1' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1' compile 'com.google.android.gms:play-services-ads:10.0.1' } 

What could be the problem? Thanks in advance for your help!

  • one
    Somewhere in the studio settings you can prescribe --stacktrace --debug for the hail and see more detailed information about the error - YuriiSPb
  • one
    And yes, by the way - Firebase will cease to be free after 3 days - YuriySPb
  • added this parameter - stacktrace - debug, overloaded IDE? but nothing has changed, just when you click on the firebase connection test button with Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and / or resync. - Rumato
  • @YuriySPb, I have a couple of days to finish everything and start pushing the newsletter :) Then I’ll figure out how to do it without a firebase, now I’m learning more. - Rumato

1 answer 1

You did not connect the plugin

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

This line should be below the dependencies section.

Like this

  dependencies { // compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:gridlayout-v7:25.0.1' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1' compile 'com.google.android.gms:play-services-ads:10.0.1'} apply plugin: 'com.google.gms.google-services' 
  • Thanks, but the plugin was connected, I do everything according to the documentation, but for some reason it does not work. - Rumato
  • In general, the problem was in the IDE, the button for checking the connection to the service does not work correctly, I assembled the application, installed it on the phone and checked it - it worked! Thanks for all the help! - Rumato