My app runs fine with the debug build and I can see Crashlytics exceptions being reported on each device I tested the app functionalities. However when I get the release build through Jenkins :
a. the app gets stuck in the launch screen which is blank.
b. get 'application has stopped' dialog.
I found some logcat messages while executing the release build:
First: it dumps the following exception
09-30 09:49:05.561: I/Crashlytics(5696): Initializing Crashlytics 1.0.4.15
09-30 09:49:05.591: E/Crashlytics(5696): .
09-30 09:49:05.591: E/Crashlytics(5696): . | |
09-30 09:49:05.591: E/Crashlytics(5696): . | |
09-30 09:49:05.591: E/Crashlytics(5696): . | |
09-30 09:49:05.591: E/Crashlytics(5696): . \ | | /
09-30 09:49:05.591: E/Crashlytics(5696): . \ /
09-30 09:49:05.591: E/Crashlytics(5696): . \ /
09-30 09:49:05.591: E/Crashlytics(5696): . \/
09-30 09:49:05.591: E/Crashlytics(5696): .
09-30 09:49:05.591: E/Crashlytics(5696): Something is missing! Find it here:
09-30 09:49:05.591: E/Crashlytics(5696): http://www.crashlytics.com/api/v1/[API_KEY]/android/confirm/[PACKAGE_NAME]
09-30 09:49:05.591: E/Crashlytics(5696): .
09-30 09:49:05.591: E/Crashlytics(5696): . /\
09-30 09:49:05.591: E/Crashlytics(5696): . / \
09-30 09:49:05.591: E/Crashlytics(5696): . / \
09-30 09:49:05.601: E/Crashlytics(5696): . / | | \
09-30 09:49:05.601: E/Crashlytics(5696): . | |
09-30 09:49:05.601: E/Crashlytics(5696): . | |
09-30 09:49:05.601: E/Crashlytics(5696): . | |
09-30 09:49:05.601: E/Crashlytics(5696): .
09-30 09:49:05.601: D/AndroidRuntime(5696): Shutting down VM
09-30 09:49:05.601: W/dalvikvm(5696): threadid=1: thread exiting with uncaught exception (group=0x40ad8228)
09-30 09:49:05.601: E/AndroidRuntime(5696): FATAL EXCEPTION: main
09-30 09:49:05.601: E/AndroidRuntime(5696): java.lang.RuntimeException: Unable to start activity ComponentInfo{[PACKAGE_NAME]/[ACTIVITY_NAME]}: com.crashlytics.android.CrashlyticsMissingDependencyException:
Second: Failed to retrieve settings from https://settings.crashlytics.com/spi/v1/platforms/android/apps/[APP_PACKAGE_NAME]/settings; [class org.json.JSONException: Value Invalid of type java.lang.String cannot be converted to JSONObject]
Third: Often complaining of not have the API_KEY in manifest. However it is already there in the manifest and running fine in debug builds.
<meta-data android:name="com.crashlytics.ApiKey" android:value="[crashlytics_api_key]"/>
inside the <application>
tag.
I also did the following:
Followed the url mentioned in the exception trace, but it redirects me to crashlytics/downloads page. probably I do not have permissions.
Added <import file="./ant_tasks/crashlytics_build.xml"/>
in build.xml and included the following source files :
crashlytics_build_base.xml, crashlytics_build.xml, crashlytics-devtools.jar and crashlytics.jar
Exported the crashlytics.jar file in Order & Export / .classpath.
<classpathentry exported="true" kind="lib" path="libs/crashlytics.jar"/>
but still does not helps.
When I uncomment Crashlytics.start(getApplicationContext());
inside Application.onCreate()
both the debug and release builds works fine, of course I do not get any crash reports.
@Override
public void onCreate() {
super.onCreate();
Crashlytics.start(getApplicationContext());
}
If someone has encountered similar issues, please help me resolving it. Many thanks in advance.
Just for my understanding:
It sounds like you're not getting the compile-time libraries and properties in the right place. I'm guessing from "My app runs fine with the debug build", that you're using a different build environment (maybe an IDE) but then on Jenkins, you're using something like Maven. The IDE integration will help you a lot for debugging, but there are additional steps to get the build functional command-line.
When you go to the download page they recommend, there should be instructions on how to deploy Crashlytics to any build system. You'll need to choose the right one, then copy/paste exactly what they have into your build files. I've done this for Maven and as long as you get the right thing in your POM you should be all set. For gradle, it may even be easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With