gradle command : crashlyticsUploadDistributionRele

2019-04-28 19:40发布

问题:

I'm trying to use the following gradle command to upload apk with flavor:

./gradlew assembleDevRelease crashlyticsUploadDistributionDevRelease

However, it's failing with the following exception log:

Caused by: com.crashlytics.tools.android.exception.DistributionException: Crashlytics halted compilation because it had a problem uploading the distribution.Project dev is inactive
    at com.crashlytics.tools.android.DistributionTasks.uploadDistribution(DistributionTasks.java:91)
    at com.crashlytics.tools.android.DeveloperTools.processProperties(DeveloperTools.java:583)
    ... 58 more

It seems like there's no packagename match on my Fabric account, but when I execute the following command, it finds it:

./gradlew tasks --all app:crashlyticsUploadDistributionDevRelease - Uploads an APK to Crashlytics for distribution.

Why am I unable to distribute my app?

My build.gradle file:

productFlavors {
    dev {
        applicationId "mypackagename.dev"
    }
    alpha {
        applicationId "mypackagename.alpha"
    }
    beta {
        applicationId "mypackagename.beta"
    }
    product {
        applicationId "mypackagename"
    }

回答1:

If you see this error:

Project is inactive.

That means your project hasn't been fully activated on the Fabric backend. After building your app, be sure to run the app as well, which will finish the activation so that you can then distribute your app.