Quickstart-android: Gradle Build crashes with Gradle Plugin Version is 3.0.0-alpha1

Created on 19 May 2017  路  8Comments  路  Source: firebase/quickstart-android

Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository file a Github issue.

    • If you are filing an issue about FCM in the background make sure to read #4 and #89 first!

  • For general technical questions, post a question on StackOverflow tagged appropriately.
  • For general Firebase discussion, use the firebase-talk google group
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel

Step 2: Describe your environment

  • Android device: Samsung Galaxy S7
  • Android OS version: 7.0
  • Google Play Services version: 11.0.47
  • Firebase/Play Services SDK version: 11.0.47

Step 3: Describe the problem:

The app Buildig makes an error with no error message

Steps to reproduce:

  1. Use Android Studio with Gradle Plugin 3.0.0-alpha1 instead of 2.3.1
  2. Try to run the App

Observed Results:

Gradle error like this:

Configuration on demand is an incubating feature.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
Configuration 'androidTestCompile' in project ':app' is deprecated. Use 'androidTestImplementation' instead.
Configuration 'testCompile' in project ':app' is deprecated. Use 'testImplementation' instead.
AGPBI: {"kind":"warning","text":"Transform \u0027FirebasePerformancePlugin\u0027 uses scope PROJECT_LOCAL_DEPS which is deprecated and replaced with EXTERNAL_LIBRARIES","sources":[{},{}]}
AGPBI: {"kind":"warning","text":"Transform \u0027FirebasePerformancePlugin\u0027 uses scope SUB_PROJECTS_LOCAL_DEPS which is deprecated and replaced with EXTERNAL_LIBRARIES","sources":[{},{}]}
AGPBI: {"kind":"warning","text":"Transform \u0027FirebasePerformancePlugin\u0027 uses scope PROJECT_LOCAL_DEPS which is deprecated and replaced with EXTERNAL_LIBRARIES","sources":[{},{}]}
AGPBI: {"kind":"warning","text":"Transform \u0027FirebasePerformancePlugin\u0027 uses scope SUB_PROJECTS_LOCAL_DEPS which is deprecated and replaced with EXTERNAL_LIBRARIES","sources":[{},{}]}
AGPBI: {"kind":"warning","text":"Transform \u0027FirebasePerformancePlugin\u0027 uses scope PROJECT_LOCAL_DEPS which is deprecated and replaced with EXTERNAL_LIBRARIES","sources":[{},{}]}
AGPBI: {"kind":"warning","text":"Transform \u0027FirebasePerformancePlugin\u0027 uses scope SUB_PROJECTS_LOCAL_DEPS which is deprecated and replaced with EXTERNAL_LIBRARIES","sources":[{},{}]}
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
:clean
:app:clean
:app:preBuild UP-TO-DATE
:app:preReleaseBuild
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:checkReleaseManifest
:app:generateReleaseBuildConfig
:app:mergeReleaseShaders
:app:compileReleaseShaders
:app:generateReleaseAssets
:app:mergeReleaseAssets
:app:createReleaseCompatibleScreenManifests
:app:processReleaseManifest
:app:fabricGenerateResourcesRelease
:app:generateReleaseResValues
:app:generateReleaseResources
:app:processReleaseGoogleServices
Parsing json file: D:\Users\Tobin\AndroidStudioProjects\Anlagenstammblatt\app\google-services.json
:app:mergeReleaseResources
:app:splitsDiscoveryTaskRelease
:app:processReleaseResources
:app:generateReleaseSources
:app:mockableAndroidJar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mockableAndroidJar'.
> java.lang.ExceptionInInitializerError (no error message)

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

BUILD FAILED in 20s
19 actionable tasks: 19 executed, 0 avoided (0%)

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

BUILD FAILED in 20s
19 actionable tasks: 19 executed, 0 avoided (0%)

Expected Results:

That it Runns the App without an error

Relevant Code:

build.gradle(Module: app):

buildscript {
    repositories {
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.0'



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

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Most helpful comment

Google has sent me the following bug fix:
We've got it to work by replacing聽classpath 'com.google.firebase:firebase-plugins:1.1.0'聽with the following:

classpath ('com.google.firebase:firebase-plugins:1.1.0') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}

This crash occurs when there are different guava dependencies and will be fixed in the next plugin version.

All 8 comments

Can you try running ./gradlew --stop and then building again? I think some running gradle daemons may be causing this (fixed it for me)

@samtstern
This doesn't work for me
but it throws an other error
Error:Execution failed for task ':app:packageInstantRunResourcesDebug'. org.gradle.tooling.BuildException (no error message)

Which sample are you trying to build? Also can you get a more detailed error message?

by just adding classpath 'com.google.firebase:firebase-plugins:1.1.0' in project gradle, we will receive following when build.
Error:java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;

Google has sent me the following bug fix:
We've got it to work by replacing聽classpath 'com.google.firebase:firebase-plugins:1.1.0'聽with the following:

classpath ('com.google.firebase:firebase-plugins:1.1.0') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}

This crash occurs when there are different guava dependencies and will be fixed in the next plugin version.

Looks like @Nibot1 found the fix for this issue a while ago. Closing, thanks!

I think that is just a workaround. And this issue should be closed only if confirmed fixed in the next release.

@seventhmoon the issue is closed here for a few reasons:

  • The issue is not something that can be fixed by changing code in this repository
  • We generally don't try to fully support pre-release software in our quickstarts

However we agree with you that this is not "solved" and we are certainly tracking it internally

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hungud picture hungud  路  6Comments

shivamsriva31093 picture shivamsriva31093  路  3Comments

smoi picture smoi  路  5Comments

UttamPanchasara picture UttamPanchasara  路  4Comments

naveenkumarn27 picture naveenkumarn27  路  4Comments