Is there a way to upload the signed apk to crashlytics?
Asked Answered
E

2

6

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.

Emmetropia answered 6/5, 2015 at 2:26 Comment(6)
Hey Jake, Mike from Crashlytics here. Can you send me a note at support@ with the package name you're trying to distribute? It looks like the app hasn't been fully activated which is why the upload is failing.Minorite
Mike, I just wrote back on the support emailEmmetropia
Hey @JackShultz did you solve this? I've been facing the same problem with signed apks.Kaufman
No I Gave Up. I could not figure it out.Emmetropia
I have the same issue. The exact same commands work on other projects. I'll dive in to see what the differences are.Homologate
I think this might be failing because by default they set betaDistributionNotifications to true and you might not be informing the ext.betaDistributionEmails and ext.betaDistributionReleaseNotesFilePath properties on your BuildType (In your case release). It took me a while to figure it out but it is working for me now on com.crashlytics.sdk.android:crashlytics:2.5.5@aar. Link to Documentation: docs.fabric.io/android/beta/gradle.htmlCrispen
H
4

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"
    }
}
Homologate answered 3/9, 2015 at 12:51 Comment(1)
I highly recommend to NOT add credentials to your gradle file! This file is probably stored in your repository. Let some get access to your code, he is also able to create new versions in your name! In your case just load a gradle file (with apply from "/path/to/") where you place your signingConfigs data so that it is NOT part of your repository. Preferable use a CI system to build and have the CI store the credentials in a secure way so that your gradle just reads them as some system variable or so.Hypotonic
B
-3

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

./gradlew clean assembleDebug crashlyticsUploadDistributionDebug

Bassorilievo answered 14/6, 2017 at 12:27 Comment(1)
This is not correct. Even debug apks are signed. But with a debug key 🗝.Saltandpepper

© 2022 - 2024 — McMap. All rights reserved.