Jack Shultz
Jack Shultz

Reputation: 2091

Is there a way to upload the signed apk to crashlytics?

I am trying to upload my app to crashlytics. I have tried building the app in Android Studio but I keep getting this message. See screenshot.

enter image description here

Then I tried the command line

./gradlew assembleRelease crashlyticsUploadDistributionRelease

:app:crashlyticsUploadDistributionRelease
Uploading /Users/jgs/Projects/Personal/APP_NAME/app/build/outputs/apk/app-release-unsigned.apk to Crashlytics...
 WARN - Crashlytics halted compilation because it can't distribute the unsigned APK: /Users/jgs/Projects/Personal/APP_NAME/app/build/outputs/apk/app-release-unsigned.apk
:app:crashlyticsUploadDistributionRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:crashlyticsUploadDistributionRelease'.
> Distribution upload failed.

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

BUILD FAILED

Total time: 1 mins 51.465 secs

Is there a way to manually upload the signed APK? I can build in Android ok, but that does not trigger an upload to crashlytics.

Upvotes: 6

Views: 6877

Answers (2)

user8160446
user8160446

Reputation: 1

If you want to upload unsigned or debug apk to Crashlytics, use the command below:

./gradlew clean assembleDebug crashlyticsUploadDistributionDebug

Upvotes: -3

Ben Groot
Ben Groot

Reputation: 5050

Got the answer:

You should provide the signing configuration within the Gradle files. If you don't it will not generate the signed .apk file within the "/build/outputs/apk/" directory.

Example (add this within the android section of your Gradle file):

buildTypes {
    release {
        ...
        signingConfig signingConfigs.release
    }
}

signingConfigs {
    release {
        // this keystore is located at module level
        storeFile file("certs/keystore.jks")
        storePassword "YOUR_PASSWORD"
        keyAlias "your_project_alias"
        keyPassword "YOUR_PASSWORD"
    }
}

Upvotes: 4

Related Questions