Giter Club home page Giter Club logo

fabricplugin's Introduction

Fabric Plugin for Cordova

Backers on Open Collective Sponsors on Open Collective

This is a Cordova plugin for Fabric.io's Crashlytics and Answers services.

It requires Cordova 6.x or newer (tested on 7.0.0) and has APIs for iOS and Android.

The iOS version uses Fabric SDK 1.7.5 and Crashlytics SDK 3.10.1 framework bundles which are located in lib/ios.

The Android version uses Gradle to get the Fabric SDK (io.fabric.tools:gradle:1.+) and the Crashlytics SDK (com.crashlytics.sdk.android:crashlytics:2.9.1) from Maven repositories when the plugin is added.

Install

  1. Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.
  2. Setup your Fabric.io account and get your API Key and Build Secret from your organization page.
  3. Add a plugin to your project using Cordova CLI, specifying the keys with the --variable argument:
# Install from npm registry:
cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx

# Or to install directly from github:
# (replace x.x.x with the tag of the version your want, or omit for HEAD)
cordova plugin add https://github.com/sarriaroman/FabricPlugin#x.x.x  --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx

Note: If you have never registered an app with your organization, the organization page may redirect you to a wizard preventing you from obtaining your keys. You may be able to obtain your keys from this page. Scroll down to the "Run Script Build Phase" block. The first, shorter string is the API key and the second, longer string is the build secret. If that doesn't work you can follow the wizard and integrate the kit into a dummy "Hello World" project which should then unlock the organization page.

Usage

The plugin is available via global variable named fabric. It exposes APIs for both Crashlytics and Answers.

A TypeScript definition file for the JavaScript interface is available in the typings directory.

API Documentation

See typings/cordova-fabric-plugin.d.ts for documentation of the JavaScript APIs including call signatures and parameter types.

Examples

Below are a few examples; see the API documentation for a complete list.

Simulate a Native Crash

window.fabric.Crashlytics.addLog("about to send a crash for testing!");
window.fabric.Crashlytics.sendCrash();

Send a Non Fatal Crash / Recording Errors

//Android and iOS
window.fabric.Crashlytics.addLog("about to send a non fatal crash for testing!");
window.fabric.Crashlytics.sendNonFatalCrash("Error message");

//iOS only. Send message and error code
window.fabric.Crashlytics.addLog("about to send a non fatal crash for testing!");
window.fabric.Crashlytics.recordError("Error message", -1);

//Android only. Send stack trace with non fatal crash (requires https://www.stacktracejs.com/)
window.fabric.Crashlytics.sendNonFatalCrash("Error message", StackTrace.getSync());

Issue Grouping

Crashes are grouped via stack trace analysis. Logged errors are grouped, instead, by the error domain and code. Remember that this means error issues can span many different call sites.

Set Information for Crash Reports

window.fabric.Crashlytics.setUserIdentifier("123");
window.fabric.Crashlytics.setUserName("Some Guy");
window.fabric.Crashlytics.setUserEmail("[email protected]");
window.fabric.Crashlytics.setStringValueForKey("bar", "foo");

Send a Sign Up Event

window.fabric.Answers.sendSignUp("Facebook", true);

Send a Sign Up Event (with custom attributes)

var attributes = {
    foo: "data",
    bar: true,
};

window.fabric.Answers.sendSignUp("Facebook", true, attributes);

Send a Add To Cart Event

window.fabric.Answers.sendAddToCart(29.95, "USD", "Foo Bar Shirt", "apparel", "123");

Notes

Automatic Configuration of Fabric SDKs

A normal installation for the Fabric SDKs involves downloading the Fabric tool and pointing it at your native code project. This tool takes care of adding references and modifying your build scripts and/or project files.

This plugin instead performs these steps via two build hooks located in the hooks directory: after_plugin_install and before_plugin_uninstall.

This allows you to avoid using the Fabric tool as well as omit your platforms directory from source control.

Automatic Debug Symbol Upload on Build

The Fabric SDK comes with a command line tool that takes care of uploading debug symbols after a build so that they can be used when viewing crash reports.

For iOS, our build hook adds a build script phase block to execute Fabric's uploader command line tool.

For Android, our build hook modifies the build.gradle file to delegate to Fabric's uploader Gradle task.

Updating Fabric and Crashlytics

Fabric and Crashlytics can be udpated via scripts/add-packages.sh. This script creates a temporary directory, obtains packages from their cocoapods download locations, and overwrites the frameworks in lib/ios.

To run the package update script:

npm run add-packages

The desired package versions are pulled from package.json:

"packages": {
    "fabric": "1.7.2",
    "crashlytics": "3.9.3"
}

Contributing

If you wish to contribute please see CONTRIBUTING.md.

Authors

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

fabricplugin's People

Contributors

alexious-sh avatar chancezeus avatar choongjoey avatar dpa99c avatar emcniece avatar fiahfy avatar hung-doan avatar jfrumar avatar justin-credible avatar monkeywithacupcake avatar nagygergo avatar nbdamian avatar noelrocha avatar nokrasnov avatar rubenstolk avatar sarriaroman avatar tiagosamaral avatar wodka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabricplugin's Issues

How to get "API Key and Build Secret"?

The instructions for getting the API Key and Build Secret does not work for me. After creating a Fabric account, I have to download the xcode plugin. How can I just define a new app on the Fabric.io site without going thru xcode?

Run Script Path Issue

Hi,

The run script generated when we do "ionic platform add ios" has the path to Crashlytics framework as

plugins/com.sarriaroman.fabric/lib/ios/Crashlytics.framework but in fact the path getting generated is

plugins/com.sarriaroman.fabric/Crashlytics.framework.

This is causing failures in CI tools.

am I doing something wrong here?

Thanks,
Dinesh

Offline app won't start

My app doesn't initialize correctly when it's offline and this plugin is included, at least on iOS. Is being online a requirement for this plugin's initialization?

Gradle tasks crashlyticsUploadDistributionDebug fails

On the root of the android project app/platforms/android must exists a file fabric.properties with the following data

apiSecret=FABRIC_API_SECRET

I think this file must be crreate on the prepare stage using the hook after_prepare

Error using window.fabric.*

Hi, thanks for your work.

When I use your plugin as in your example I get TypeError: undefined is not an object (evaluating 'window.fabric.Crashlytics') in console.
I am using iPhone 5 with iOS 9.2, cordova 6.0.0, Crashlytics 3.6.0, Answers 1.1.0.

Edit : Well, I have more informations about this bug. I tested in chrome, everything is ok. When I test in safari 9 (used by iOS), logging window object, I find fabric as a sub-object that is not undefined. But logging window.fabric is undefined. I think the problem comes from the initialization of FabricPlugin variable.

var FabricPlugin = (function () {
function FabricPlugin() {
    _classCallCheck(this, FabricPlugin);
}

_createClass(FabricPlugin, [{
    key: 'pluginCallName',
    value: function pluginCallName() {
        return 'FabricPlugin';
    }
}, {
    key: 'execPlugin',
    value: function execPlugin(method, parameters) {
        exec(null, null, this.pluginCallName(), method, [parameters]);
    }
}]);

    return FabricPlugin;
})();

module.exports = new FabricPlugin();

Where you use FabricPlugin variable inside its declaration itself and return it. As it is initializing, FabricPlugin variable is not yet defined when returning it. Some browser may interpret it differently, and return different value. Or not... I don't know, I am not enough friend with javascript.

Your fabric.properties file is missing your build secret.

I created a Cordova project and added the Android platform and the cordova-fabric- plugin with my Facric.io keys (both API and Secret). Then I build the project.

When executing gradlew task 'crashlyticsUploadDistributionDebug' on Windows command line I keep getting the following error:
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Your fabric.properties file is missing your build secret.

When looking at the platforms/android folder the fabric.properties file is missing. I don't know if it is a problem when building the project.

What could be the problem?

Beta testing support

Saw this mentioned previously but only response was saying to just try. I haven't had any success with the desktop app recognizing the build when it is archived. It works when I use the native crashlytics beta code not with the plugin. Is this supported and I am doing it wrong?

Error: Module cordova-fabric-plugin.FabricPlugin does not exist.

cordova-ios 4.1.1
cordova-fabric-plugin 1.0.7

airbrake.js reported this exception from a production device -- I've never seen it in development, so not too sure how to reproduce. I'm happy to do what I can to help debug, but please let me know what you need.

Thanks!!

var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1365:24 in file:///var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1586:23
var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1375:13 in file:///var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1586:23
var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1599:38 in file:///var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1586:23
var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1632:36 in file:///var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1586:23
: in file:///var/containers/Bundle/Application/A7DE0975-3FFD-4A8B-9030-51D308C190B4/CWA.app/www/cordova.js:1586:23

is there any way to specify fabric distribution properties with this plugin?

I'm uploading a build to Crashlytics with the following command:

./gradlew assembleRelease crashlyticsUploadDistributionArmv7Release

As it's described here it's possible to specify distribution group and release notes:

ext.betaDistributionReleaseNotes=”Release Notes for this build.”
ext.betaDistributionEmails="[email protected], [email protected]"
ext.betaDistributionGroupAliases=”my-best-testers”

The only way to do that now is to create build-extras.gradle

If you need to customize build.gradle, rather than edit directly, you should create a sibling file named build-extras.gradle. This file will be included by the main build.gradle when present.

iOS Shell Script path error

I have an app build on Cordova that runs both iOS and Android. When I set up the plugin, after tinkering with it a while I managed to get it working on iOS by changing the addShellScriptBuildPhase to use in the script instead of the path to /lib/ios/Crashlytics.framework... to /lib/ios/Fabric.framework... as it appears on the Fabric dashboard instructions. After this change, the data was loaded properly into Fabric dashboard.

Ionic2 / Fabric

Hello,

Please let me know how do i need to use the plugin on Ionic2, here's my code :

import {Component} from '@angular/core';
import {Platform, ionicBootstrap} from 'ionic-angular';
import {StatusBar, Push} from 'ionic-native';
import {TabsPage} from './pages/tabs/tabs';
import {HTTP_PROVIDERS} from '@angular/http';
import {CloudSettings, provideCloud} from '@ionic/cloud-angular';

const cloudSettings: CloudSettings = {
'core': {
'app_id': '363e500b'
}
};

@component({
template: '<ion-nav [root]="rootPage">',
providers: [HTTP_PROVIDERS]
})
export class MyApp {

private rootPage: any;

constructor(private platform: Platform) {
this.rootPage = TabsPage;

platform.ready().then(() => {

  StatusBar.styleDefault();

  var push = Push.init({
    ios: {
      alert: "true",
      badge: true,
      sound: 'false'
    }
  });

  push.on('registration', (data) => {
    console.log(data.registrationId);
    alert(data.registrationId.toString());
  });

  push.on('notification', (data) => {
    console.log(data);
    alert("Hi, Am a push notification");
  });

  push.on('error', (e) => {
    console.log(e.message);
  });


});

}
}

ionicBootstrap(MyApp, [provideCloud(cloudSettings)]);

Thanks

Split crashes into different issues

Hello everyone!

I have just installed and tested this plugin in my ionic mobile app, and it looks so cool allowing me to know every crash the user experiences while using the app.

But there's only one thing that I would like to improve. As all the crash exceptions are throwed from the same line in the native code, Crashlytics groups them all. 👎

I barely remember that you can create (on Android) a custom RuntimeException and throw it causing the same result as the one that we have now. Am I right? Will it be possible to create one custom exception to unify the values that we have from JS exception like file, line, etc?

Is there any workaround you are using right now to make Crashlytics clearer? Any idea about iOS?

Thank you, Best regards,
Jesús.

Crash is not being sent to fabric

Hello,

If I use the sendCrash() command, the error is sent to fabric.
But if I force an error in javascript, doing an while true, the error is not sent.

I think that I don´t need to handle the error, or else it won´t be a crash, right?

Could you give me some help?

Thanks!

Applications with Spaces in the Name

Hello with the latest release 1.0.9 running into a problem with the application name. When running within a CLI environment, the post-build-hook runs unsuccessfully as the path to the Crashalytics folder is invalid.

#!/bin/sh
My Project Folder/Plugins/cordova-fabric-plugin/Fabric.framework/run ######### #######

This results in the output...

My Project Folder/Plugins/cordova-fabric-plugin/Fabric.framework/run: No such file or directory

If i open up the hook script and escape the path the process works fine as well as if i downgrade the plugin to 1.0.8

Getting an "Cannot read property 'FABRIC_API_KEY' of undefined" installing the plugin

Verified using a sample project and I'm running the following:

cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=###### --variable FABRIC_API_SECRET=######

cordova v6.1.1
nodejs v4.4.3

Here's the full stack trace:

Fetching plugin "cordova-fabric-plugin" via npm
Installing "cordova-fabric-plugin" for ios
Failed to install 'cordova-fabric-plugin':TypeError: Cannot read property 'FABRIC_API_KEY' of undefined
    at Object.module.exports.getPluginConfig (/Users/darrenw/Projects/cordova_sample/hello/plugins/cordova-fabric-plugin/hooks/lib/utilities.js:60:64)
    at Object.module.exports.addShellScriptBuildPhase (/Users/darrenw/Projects/cordova_sample/hello/plugins/cordova-fabric-plugin/hooks/lib/ios-helper.js:22:38)
    at module.exports (/Users/darrenw/Projects/cordova_sample/hello/plugins/cordova-fabric-plugin/hooks/after_plugin_install.js:22:19)
    at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:167:18)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:145:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:130:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:810:14
Error: Cannot read property 'FABRIC_API_KEY' of undefined

Error: ENOENT: no such file or directory, open '/Volumes/<volumeName>/<projectName>/platforms/ios/._<projectName>/config.xml'

On Mac OS X
I have move my project folder to a second partition on the hard disk with fat32 format and this error is happening:
`
cp: copyFileSync: could not write to dest file (code=ENOENT):/Volumes/Data/w_jboss/bajale_app/platforms/ios/._Bajale/config.xml

Parsing /Volumes/Data/w_jboss/bajale_app/platforms/ios/._Bajale/config.xml failed
Error: ENOENT: no such file or directory, open '/Volumes/Data/w_jboss/bajale_app/platforms/ios/._Bajale/config.xml'

or this
vms-Mac:bajale_app vmmac$ cordova build android
shell.js: internal error
Error: ENOENT: no such file or directory, lstat '/Volumes/Data/w_jboss/bajale_app/platforms/android/assets/www/assets/._.DS_Store'
at Error (native)
at Object.fs.lstatSync (fs.js:887:18)
at rmdirSyncRecursive (/Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/node_modules/shelljs/src/rm.js:20:23)
at rmdirSyncRecursive (/Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/node_modules/shelljs/src/rm.js:23:7)
at /Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/node_modules/shelljs/src/rm.js:159:7
at Array.forEach (native)
at Object._rm (/Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/node_modules/shelljs/src/rm.js:123:9)
at Object.rm (/Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/node_modules/shelljs/src/common.js:186:23)
at updateWwwFrom (/Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/lib/prepare.js:96:11)
at Api.module.exports.prepare (/Volumes/Data/w_jboss/bajale_app/platforms/android/cordova/lib/prepare.js:38:19)

`

App not registered in Fabric

Hi,

I have a Ionic2 + Cordova app created and did the steps below for installing this plugin, however I can't get the app registered in Fabric Dashboard, indeed I don't see it at all! If I start the app and do a sendCrash() the app closes as expected and sending a sendNonFatalCrash() does not close the app. So, I guess the plugin is installed and working.. however the app is not on dashboard or email notifications arrived.

I already checked API and SECRET keys 2 o 3 times.

Installed everything with

$cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=XXX
$cordova platform add ios 
$cordova platform add android
$cordova prepare ios
$cordova prepare android

Then created cordova-fabric-plugin.d.ts with the content of your github file under typings directory

$typings install file:typings/cordova-fabric-plugin.d.ts --global --save

Finally added Logs and sendCrash methods in my app.ts and executed it on my android phone.

$ionic run android

Thanks in advance!

Daniel

iOS app not detected

I am working on a cordova app for android and ios. I added you plugin as described. The android version was detected instantly and everything seems to work fine. However i don't see the ios version of my app in the fabric dashboard. My API keys seem to be working fine - otherwise the android app wouldn't work. I also tried to remove and add the platform as well as the plugin. Calling window.fabric.Crashlytics.sendCrash(); actually crashes the app, so i think the plugin was integrated successfully. Could it be a problem that i am deploying with Visual Studio 2015 on a remote mac?

sendNonFatalCrash only sends the info to fabric.io after calling sendCrash

Hi, first of all, awesome plugin, I have been using it and is very good :)

Right now I have a request to log Non-Fatal Crashes, right now the sendNonFatalCrash function works but you have to call the sendCrash function after it in order for the app to actually send the info to Fabric.

So for example, if I do this:

window.fabric.Crashlytics.addLog('test 1');
window.fabric.Crashlytics.sendNonFatalCrash();
window.fabric.Crashlytics.addLog('test 2');
window.fabric.Crashlytics.sendNonFatalCrash();

and then I wait for and hour, there's no new Non-Fatal crashes reports in Fabric.
I have to call window.fabric.Crashlytics.sendCrash(); to actually see the Non-Fatal crashes in Fabric.

Thanks.
Robert

Missing logException from API

Seems like logException from Crashlytics is missing from this implementation.

Do you have any plans for implementing it in the near time?

Download Fabric SDK for iOS when plugin is added.

As suggested in #4 (comment) we should download the Fabric SDK for iOS from Fabric's servers when the plugin is added.

This has several advantages:

  • Consistent with Android (which obtains the SDK via Gradle)
  • Avoids potential licensing issues (re: distribution of Fabric's binaries)
  • Makes it easier to update the plugin (update download URL and hashes)

Changes Required:

armv7 and x86 apks

This is a question about how to make these available to beta users. Do I need to create two android apps?

Fabric plugin fails along with Digits plugin

cordova build android

ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
Download https://maven.fabric.io/public/io/fabric/tools/gradle/1.21.6/gradle-1.21.6.pom
Download https://maven.fabric.io/public/io/fabric/tools/gradle/1.21.6/gradle-1.21.6.jar

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/.../workspace/.../android/build.gradle' line: 322

  • What went wrong:
    A problem occurred evaluating root project 'android'.

    Failed to apply plugin [id 'io.fabric']
    Cannot add extension with name 'crashlytics', as there is an extension already registered with that name.

  • 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: 40.904 secs

Report the console logs with the crash report

First of all this is a great plugin doing exactly what it needs to do.
Being a cordova app mostly we require the javascript console logs when the app crashes. I believe if this could be add to the plugin to upload the console logs when the app crashes it will be so nice

Cannot use an app name of just numbers - plugin fails to install

Some of our customers create apps whose names are all numbers (e.g. 4774). This causes the Fabric plugin to break our build with:

[11:15:33][Step 5/11] Processing plugin cordova-fabric-plugin
[11:15:33][Step 5/11] Plugin "cordova-fabric-plugin" is not present in the project. See `cordova plugin list`.
[11:15:33][Step 5/11] Reinstalling from local cache /Users/administrator/Documents/workspace/TeamCity/buildAgent/work/81be14552183a762/staging/.groupahead-plugin-cache/FabricPlugin
[11:15:34][Step 5/11] Installing "cordova-fabric-plugin" for android
[11:15:35][Step 5/11] Installing "cordova-fabric-plugin" for ios
[11:15:35][Step 5/11] Error during processing of action! Attempting to revert...
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Failed to install 'cordova-fabric-plugin':TypeError: Uh oh!
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] undefined is not a function
[11:15:35][Step 5/11]     at unquote (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:1016:25)
[11:15:35][Step 5/11]     at pbxProject.addToFrameworkSearchPaths (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:742:13)
[11:15:35][Step 5/11]     at pbxProject.addFramework (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:206:12)
[11:15:35][Step 5/11]     at Object.module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/ios.js:182:41)
[11:15:35][Step 5/11]     at installWrapper (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
[11:15:35][Step 5/11]     at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
[11:15:35][Step 5/11]     at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:576:20)
[11:15:35][Step 5/11]     at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:363:28
[11:15:35][Step 5/11]     at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
[11:15:35][Step 5/11]     at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
[11:15:35][Step 5/11] TypeError: Uh oh!
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] undefined is not a function
[11:15:35][Step 5/11]     at unquote (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:1016:25)
[11:15:35][Step 5/11]     at pbxProject.addToFrameworkSearchPaths (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:742:13)
[11:15:35][Step 5/11]     at pbxProject.addFramework (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:206:12)
[11:15:35][Step 5/11]     at Object.module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/ios.js:182:41)
[11:15:35][Step 5/11]     at installWrapper (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
[11:15:35][Step 5/11]     at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
[11:15:35][Step 5/11]     at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:576:20)
[11:15:35][Step 5/11]     at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:363:28
[11:15:35][Step 5/11]     at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
[11:15:35][Step 5/11]     at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
[11:15:35][Step 5/11] [11:15:35] Error: Shell.exec command 'cordova plugin add /Users/administrator/Documents/workspace/TeamCity/buildAgent/work/81be14552183a762/staging/.groupahead-plugin-cache/FabricPlugin --variable FABRIC_API_KEY=737cc6bd5abc33a454a9f8a3c4564b970121610f --variable FABRIC_API_SECRET=980d06c003c4d0529c700cc37f5db6fd2b43bf1c9b765d44013e055e728942ae' returned non-zero exit code of 1. Output was: Installing "cordova-fabric-plugin" for android
[11:15:35][Step 5/11] Installing "cordova-fabric-plugin" for ios
[11:15:35][Step 5/11] Error during processing of action! Attempting to revert...
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Error during reversion of action! We probably really messed up your project now, sorry! D:
[11:15:35][Step 5/11] Failed to install 'cordova-fabric-plugin':TypeError: Uh oh!
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] undefined is not a function
[11:15:35][Step 5/11]     at unquote (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:1016:25)
[11:15:35][Step 5/11]     at pbxProject.addToFrameworkSearchPaths (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:742:13)
[11:15:35][Step 5/11]     at pbxProject.addFramework (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:206:12)
[11:15:35][Step 5/11]     at Object.module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/ios.js:182:41)
[11:15:35][Step 5/11]     at installWrapper (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
[11:15:35][Step 5/11]     at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
[11:15:35][Step 5/11]     at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:576:20)
[11:15:35][Step 5/11]     at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:363:28
[11:15:35][Step 5/11]     at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
[11:15:35][Step 5/11]     at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
[11:15:35][Step 5/11] TypeError: Uh oh!
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] A reversion action failed: undefined is not a function
[11:15:35][Step 5/11] undefined is not a function
[11:15:35][Step 5/11]     at unquote (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:1016:25)
[11:15:35][Step 5/11]     at pbxProject.addToFrameworkSearchPaths (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:742:13)
[11:15:35][Step 5/11]     at pbxProject.addFramework (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/xcode/lib/pbxProject.js:206:12)
[11:15:35][Step 5/11]     at Object.module.exports.framework.install (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/platforms/ios.js:182:41)
[11:15:35][Step 5/11]     at installWrapper (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:77:32)
[11:15:35][Step 5/11]     at Object.ActionStack.process (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/action-stack.js:68:25)
[11:15:35][Step 5/11]     at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:576:20)
[11:15:35][Step 5/11]     at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:363:28
[11:15:35][Step 5/11]     at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
[11:15:35][Step 5/11]     at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)

phonegap build

Hi, is there a way to use this plugin with phonegap build? thank you

Fabric plugin using Fabric desktop app

Hello,

I am currently using this plugin in one of my app. I tried installing this plugin via Fabric desktop app, and in one step, it asked to me make some code changes

With Fabric, it takes just a few lines of code to get Crashlytics up and running in your app.

Click to copy the blue snippets and then paste them into your code.

#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>

and add following in one of the methods: [Fabric with:@[[Crashlytics class]]];


- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    self.viewController = [[MainViewController alloc] init];
    [Fabric with:@[[Crashlytics class]]];
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

I did not do any such code changes with 'cordova-fabric-plugin' but I was able to send non-fatal crashes to Fabric, should I still do it when using this plugin?

-Thanks

iOS not being detected after app was re-signed

We have an iOS app signed with an enterprise licence which works great with Fabric and this plugin. But for our client we have to upload that app to a propiertary app store where it is resigned with a new App ID. After this process, the app is not detected in Fabric any more. How could we overcome this?

Plugin id different from npm package name

When i install the plugin from npm it keep installing everytime i run cordova prepare:

Discovered plugin "cordova-fabric-plugin" in config.xml. Installing to the project Fetching plugin "cordova-fabric-plugin@~1.0.5" via npm Plugin "com.sarriaroman.fabric" already installed on android. Plugin "com.sarriaroman.fabric" already installed on ios.

I installed the plugin adding this in my config.xml:
<plugin name="cordova-fabric-plugin" spec="~1.0.5"> <variable name="FABRIC_API_KEY" value="xxx" /> <variable name="FABRIC_API_SECRET" value="xxx" /> </plugin>

In plugin.xml i see the id is:
<plugin id="com.sarriaroman.fabric" version="1.0.5" xmlns="http://www.phonegap.com/ns/plugins/1.0">

I think this is because the plugin id is different from the npm package name.

Is it reasonable to change the plugin id to cordova-fabric-plugin?

Initialisation failed + crash

Hi,
I'm trying to add the plugin to my project, but I'm facing several issues.
I don't really understand the plugin/framework init process. From my understanding of the fabric system, when the app is launch for the first time is should register / present itself to the backend (and appear under my organisation)
But I can't get my app registered on fabric.io.
Shouldn't the plugin call

Fabric.with()

at some point ?

Another problem I have is when I use

window.fabric.Answers.sendLogIn()

the app crash

E/AndroidRuntime(15212): FATAL EXCEPTION: main
E/AndroidRuntime(15212): Process: com.xxx.yyy, PID: 15212
E/AndroidRuntime(15212): java.lang.IllegalStateException: Must Initialize Fabric before using singleton()
E/AndroidRuntime(15212):    at io.fabric.sdk.android.Fabric.singleton(Fabric.java:265)
E/AndroidRuntime(15212):    at io.fabric.sdk.android.Fabric.getKit(Fabric.java:516)
E/AndroidRuntime(15212):    at com.crashlytics.android.answers.Answers.getInstance(Answers.java:45)
E/AndroidRuntime(15212):    at com.sarriaroman.fabric.FabricPlugin$2.run(FabricPlugin.java:79)
E/AndroidRuntime(15212):    at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(15212):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(15212):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(15212):    at android.app.ActivityThread.main(ActivityThread.java:5292)
E/AndroidRuntime(15212):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(15212):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(15212):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime(15212):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)

android app not being detected

I have an app build on Cordova that runs both iOS and Android. When I set up the plugin, after tinkering with it a while I managed to get it working with iOS but no luck at all with Android. It throws no errors on the plugin, both Answers and Crashlytics functions seem to go by unnoticed, the sendCrash does crash the app but no logs are sent to the Fabric dashboard.

Am I missing something? If anyone else has a working app using this, how did you manage to set it up?

How to impediment with ionic so when a crash happen it report automatcally

while simulating with a native crash using
window.fabric.Crashlytics.addLog("about to send a crash for testing!");
window.fabric.Crashlytics.sendCrash();
menlly form console it send report ok.
So how to report about crash automatically in ionic app. and where to put

window.fabric.Crashlytics.addLog("about to send a non fatal crash for testing!");
window.fabric.Crashlytics.sendNonFatalCrash("Error message");

in js file.

Runtime Exception: com.sarriaroman.fabric.FabricPlugin$1.run(FabricPlugin.java:118)

This exception has been reported already but the issue was closed ... I am still experiencing the same problem After installing the plugin, Fabric is initialized and working (app shows up in the fabric dashboard). I am also receiving crash alerts. However, as soon as I try to run the following test code:

window.fabric.Crashlytics.addLog("about to send a crash for testing!");
window.fabric.Crashlytics.sendCrash();

App closes and I get this reported back:

Fatal Exception: java.lang.RuntimeException: This is a crash
at com.sarriaroman.fabric.FabricPlugin$1.run(FabricPlugin.java:118)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6897)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Removing the Fabric plugin leaves cruft in the build.gradle file

If you add and then later remove this plugin, the Fabric config that was appended to the build.gradle file is not removed.

If you re-add the plugin you'll notice at the bottom of your build.gradle file that the config is now appended twice.

At first I filed this as a Cordova issue: https://issues.apache.org/jira/browse/CB-11572

Looks like it's related to https://github.com/sarriaroman/FabricPlugin/blob/master/hooks/lib/android-helper.js#L34.

[iOS] Can't upload dSYMs to Fabric

I'm stuck, getting in this error:

It looks like we are missing dSYMs to process crashes for the versions below.

I try to upload dSYMs file to Fabric(through https://fabric.io website).
But that site not working! It seem do nothing at all, It does not tell that if I select file progress is success, or If file upload is complete.

And does this plugin support to upload dSYMs to Fabric, automatically ?
If not, Is there any command to upload dSYMs to Fabric?

Include libraries and update native projects on plugin install

We are using the cordova-crashlytics-plugin and are looking to upgrade to a newer plugin that uses the updated Fabric SDK.

There are two things this old plugin does that makes it really convenient to use.

  1. It includes the Fabric SDK libraries with the plugin.
  2. Uses an after_plugin_install build hook to modify the iOS and Android projects.

This makes it possible to use the plugin without checking in the platforms directory or doing any manual configuration steps. I would assume this would also take care of #2 as well.

App-restart required for errors to show up

I'm using this plugin with my Ionic app on an Android device and I log errors with window.fabric.Crashlytics.sendNonFatalCrash("ERROR");

But the errors are only visible in the Fabric UI after killing the app and restarting it. Does anybody have a solution for this?

Sending crash report crashes the app, how ironic :)

So, im sending a crash, nothing to fancy

window.onerror = (message, source, lineno, colno, error) ->
  if fabric?
    console.log "Sending crash to Fabric.io"
    if CurrentUser? and CurrentUser.signedIn()
      fabric.Crashlytics.setUserIdentifier CurrentUser.get('id') 
      fabric.Crashlytics.setUserName CurrentUser.get('name')

    fabric.Crashlytics.addLog "#{message} | #{source} | #{lineno}:#{colno} | #{error}"
    fabric.Crashlytics.sendCrash()

than i get this error ( in crashlitcs so thats nice! )

Non-fatal Exception: java.lang.Throwable: Sending non fatal crash from JS
       at com.sarriaroman.fabric.FabricPlugin$6.run(FabricPlugin.java:158)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5254)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

cordova-fabric-plugin':Error: ENOENT: no such file or directory, open 'config.xml

I have an error when I try to add ios platform with this plugin.

$ cordova platform add ios
Adding ios project...
iOS project created with [email protected]
Installing "co.medicast.plugins.MapLauncher" for ios
Installing "com.organizer.plugins.callcapability" for ios
Installing "com.organizer.plugins.callcenter" for ios
Installing "cordova-fabric-plugin" for ios
Parsing config.xml failed
Failed to install 'cordova-fabric-plugin':Error: ENOENT: no such file or directory, open 'config.xml'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/util/xml-helpers.js:118:27)
at Object.ConfigParser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ConfigParser/ConfigParser.js:33:24)
at getAppName (/Users/aleksejdanilov/documents/work/organizer/fo/fo_web/plugins/cordova-fabric-plugin/hooks/lib/utilities.js:17:18)
at Object.module.exports.getXcodeProjectPath (/Users/aleksejdanilov/documents/work/organizer/fo/fo_web/plugins/cordova-fabric-plugin/hooks/lib/utilities.js:79:23)
at module.exports (/Users/aleksejdanilov/documents/work/organizer/fo/fo_web/plugins/cordova-fabric-plugin/hooks/after_plugin_install.js:20:42)
at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:167:18)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:145:16)
Error: ENOENT: no such file or directory, open 'config.xml'

Phonegap Build

I can´t build an android aplication with Adobe Phonegap Build...
Please help me.
The log shows this:

compile: [javac] Compiling 46 source files to /project/bin/classes [javac] /project/src/com/sarriaroman/fabric/FabricPlugin.java:9: error: package com.crashlytics.android does not exist [javac] import com.crashlytics.android.Crashlytics;

And then:

BUILD FAILED
/android-sdk/tools/ant/build.xml:716: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.
Total time: 6 seconds
/project/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: ant with args: debug,-f,/project/build.xml

sendContentView & sendCustomEvent doesn't work

Hello,

I recently created a new cordova projet with the latest version.
I added this plugin to try Fabric engine and after many tests on Android platform, I couldn't send Content View event or Custom event.
Others works.
No errors in JavaScript Console.

Do you have an idea to fix this ?

Thanks.

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.