Cordoba and crashlytics beta build script

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 fine, 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 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?

+5
source share
2 answers

I got this job ...

To install Fabric in build.gradle , I did the following ...

  • Install Android Studio.
  • Install the Fabric plugin for Android Studio.
  • Open the project in platforms/android in Android Studio.
  • Press the β€œFabric” button on the toolbar, log in and go through the installation wizard.

The wizard tells you what it adds to the project, so if you are really motivated, you can write your own script to do the same. This would mean that you could build from the command line without checking platforms/android .

Subsequently, the script you provided works fine.

+1
source

It appears that during the build process you should install the cordova plugin.

Try to make one of them (Ionic uses cordova here for archive sake):

 # via command line install cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=${FABRIC_API_KEY} --variable FABRIC_API_SECRET=${FABRIC_BUILD_SECRET} # install from source cordova plugin add https://github.com/sarriaroman/FabricPlugin#xxx --variable FABRIC_API_KEY=${FABRIC_API_KEY} --variable FABRIC_API_SECRET=${FABRIC_BUILD_SECRET} # using ionic ionic plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=${FABRIC_API_KEY} --variable FABRIC_API_SECRET=${FABRIC_BUILD_SECRET} 

Your script will look something like this:

 # now execute the commands in your script cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=${FABRIC_API_KEY} --variable FABRIC_API_SECRET=${FABRIC_BUILD_SECRET} 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 
0
source

Source: https://habr.com/ru/post/1211963/


All Articles