I am trying to write a script file that builds my apk and uploads it to Crashlytics beta without success.
echo "\n > cordova build android\n"
cordova build android --release
echo "\n > signing apk\n"
jarsigner \
-storepass $STOREPASS \
-sigalg SHA1withRSA \
-digestalg SHA1 \
-keystore $KEYSTORE \
$APK_PATH \
$NAME
mkdir -p releases
zipalign -f -v 4 \
$APK_PATH \
$TARGET_PATH
the script works perfectly but when I run
java -jar scripts/crashlytics-devtools.jar \
-projectPath $PROJECT_PATH \
-androidManifest $PROJECT_PATH/AndroidManifest.xml \
-androidRes $PROJECT_PATH/res \
-androidAssets $PROJECT_PATH/assets \
-apiKey $FABRIC_API_KEY \
-apiSecret $FABRIC_BUILD_SECRET \
-uploadDist $APK \
-verbose
it gives me a Exception in thread "main" com.crashlytics.tools.android.DeveloperTools$PluginException: Crashlytics halted compilation because it can't extract Crashlytics build info from the APK
Any help?
I got this working by…
platforms/android/build.gradle
Installing the Fabric plugin
https://github.com/engincancan/cordova-fabric-io-plugin
To install Fabric into the build.gradle
I did the following…
platforms/android
in Android Studio.The wizard tells you what it is adding to the project so, if you are really motivated, you could write your own script to do the same thing. This would mean that you could build from the command line without checking in platforms/android
.
Afterwards the script you provided works fine.
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