Code Monkey home page Code Monkey logo

Comments (8)

Justin-Credible avatar Justin-Credible commented on September 18, 2024

I would double check that you've added the plugin after you've added your platforms so that the build hooks can update the platform files properly.

Here are the steps I used to try and reproduce your problem:

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

D:\Development>npm install cordova -g
C:\Users\Justin\AppData\Roaming\npm\cordova -> C:\Users\Justin\AppData\Roaming\npm\node_modules\cordova\bin\cordova
[email protected] C:\Users\Justin\AppData\Roaming\npm\node_modules\cordova
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected],
[email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

D:\Development>node --version
v4.2.4

D:\Development>cordova --version
6.1.1

D:\Development>cd Temp

D:\Development\Temp>cordova create TestApp6
Creating a new cordova project.

D:\Development\Temp>cd TestApp6

D:\Development\Temp\TestApp6>cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: io.cordova.hellocordova
        Name: HelloCordova
        Activity: MainActivity
        Android target: android-23
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.


D:\Development\Temp\TestApp6>cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=xxx --variable FABRIC_API_SECRET=xxx
Fetching plugin "cordova-fabric-plugin" via npm
Installing "cordova-fabric-plugin" for android

D:\Development\Temp\TestApp6>cordova prepare android

D:\Development\Temp\TestApp6>cordova build android

# Lots of build output here

Total time: 1 mins 36.681 secs
Built the following apk(s):
        D:/Development/Temp/TestApp6/platforms/android/build/outputs/apk/android-debug.apk

D:\Development\Temp\TestApp6>

from fabricplugin.

mhv1 avatar mhv1 commented on September 18, 2024

I have tried the same steps you mentioned but still no luck. These are the steps I performed:

C:\Users\Milan\Documents\Cordova>cordova create TestApp
Creating a new cordova project.

C:\Users\Milan\Documents\Cordova>cd TestApp

C:\Users\Milan\Documents\Cordova\TestApp>cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: io.cordova.hellocordova
        Name: HelloCordova
        Activity: MainActivity
        Android target: android-23
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

C:\Users\Milan\Documents\Cordova\TestApp>cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXXXX --variable FABRIC_API_SECRET=XXXXX
Fetching plugin "cordova-fabric-plugin" via npm
Installing "cordova-fabric-plugin" for android

C:\Users\Milan\Documents\Cordova\TestApp>cordova prepare android

C:\Users\Milan\Documents\Cordova\TestApp>cordova build android
--Output Omitted--

BUILD SUCCESSFUL
Total time: 18.541 secs
Built the following apk(s):
        C:/Users/Milan/Documents/Cordova/TestApp/platforms/android/build/outputs/apk/android-debug.apk

C:\Users\Milan\Documents\Cordova\TestApp>cd platforms/android

C:\Users\Milan\Documents\Cordova\TestApp\platforms\android>gradlew.bat
--Output Omitted--

BUILD SUCCESSFUL
Total time: 6.204 secs

C:\Users\Milan\Documents\Cordova\TestApp\platforms\android>gradlew.bat crashlyticsUploadDistributionDebug
:crashlyticsUploadDistributionDebug
Uploading C:\Users\Milan\Documents\Cordova\TestApp\platforms\android\build\outputs\apk\android-debug.apk to Crashlytics...
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Your fabric.properties file is missing your build secret.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact [email protected] for assistance.

--Output Omitted--

:crashlyticsUploadDistributionDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':crashlyticsUploadDistributionDebug'.
> Crashlytics Developer Tools error.
* 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: 6.0 secs

I was thinking I'm probably missing someting. This is the first time I use Cordova so I'm not to familiar with the build process or anything else that isn't in the Cordova documentation.

Thank you for your help.

from fabricplugin.

mhv1 avatar mhv1 commented on September 18, 2024

BTW, What I want to do is run the script on a CI server (Jenkins) in order to automate the beta distribution of the app. One of my workmates manged to get it working on iOS following these steps:

cordova platform add ios
cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXXXX --variable FABRIC_API_SECRET=XXXXX
cordova build ios

./platforms/ios/CordovaExamples/Plugins/cordova-fabric-plugin/Crashlytics.framework/submit XXXXX -emails [email protected] -notifications YES -ipaPath ./platforms/ios/build/device/example.ipa

But we think the steps might be quite different for Android since Gradle works different.

from fabricplugin.

Justin-Credible avatar Justin-Credible commented on September 18, 2024

Ah, sorry. I missed the fact that you are trying to upload your build.

Below is the command I use to upload my APKs to Crashlytics after running cordova build android --release. You'll need the crashlytics-devtools.jar file which has the upload command.

You can also optionally specify your release notes this way.

java -jar resources/android/crashlytics-devtools.jar -apiSecret xxx -apiKey xxx -verbose -projectPath platforms/android -androidManifest platforms/android/AndroidManifest.xml -androidRes platforms/android/res -androidAssets platforms/android/assets -requireUploadSuccess -uploadDist platforms/android/build/outputs/apk/android-armv7-release.apk -betaDistributionReleaseNotesFilePath resources/android/beta-release-notes.txt

from fabricplugin.

mhv1 avatar mhv1 commented on September 18, 2024

I have downloaded the 'crashlytics-devtools.jar' file from Fabric.io (unless there is another way of getting it?) and followed these steps:

C:\Users\Milan\Documents\Cordova\TestApp>cordova build android –debug

C:\Users\Milan\Documents\Cordova\TestApp>java -jar crashlytics-devtools.jar -apiSecret XXXXX -apiKey XXXXX -verbose -projectPath platforms/android -androidManifest platforms/android/AndroidManifest.xml -androidRes platforms/android/res -androidAssets platforms/android/assets -requireUploadSuccess -uploadDist platforms/android/build/outputs/apk/android-debug.apk

C:\Users\Milan\Documents\Cordova\TestApp>

The command seems to be successful but I cannot see the application in Fabric.io. I don’t know if I’m missing anything. I read in the Fabric documentation that the 'crashlytics-devtools.jar' is necessary when using Ant and not Gradle, but I don't know if it makes any difference.

from fabricplugin.

Justin-Credible avatar Justin-Credible commented on September 18, 2024

You should already be able to see your app in the Fabric console. If it isn't showing up there, even before uploading a build, then the plugin may not be installed correctly.

After installing the plugin and launching the app for the first time, you should be able to see your app in the Fabric dashboard or at the top left drop down in Fabric.

from fabricplugin.

mhv1 avatar mhv1 commented on September 18, 2024

Great! It works now. The problem was that I wasn't launching the app at all. I thought that only building it would be enough, just like in iOS (as I showed in one of my previous comments).

One last thing: Is it possible to upload the build without having to launch the application in a device or emulator? Like I said before, I'm automating the process using a CI server and I don't have a way of running the app there.
Thank you very much for your help anyway.

from fabricplugin.

Justin-Credible avatar Justin-Credible commented on September 18, 2024

You only have to run the app once for each platform (iOS and Android) for it to show up in the Fabric dashboard. After that you can simply use the command line tools (Crashlytics.framework/submit and crashlytics-devtools.jar) to upload builds without launching the app again.

Glad you got it working!

from fabricplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.