sarriaroman / FabricPlugin

Fabric.io plugin for Cordova or Phonegap
MIT License
198 stars 159 forks source link

The plugin crashes with com.crashlytics.android.core.CrashlyticsMissingDependencyException #88

Open giordy opened 7 years ago

giordy commented 7 years ago

Hello,

first of all thanks for your work :) I integrated your plugin and it worked well in the debug phase while testing the app in the emulator and the phone. The problem arised after I created the release apk and installed on the phone for testing. Then I got this exception:

02-21 14:17:21.347 13313 13313 I CrashlyticsCore: Initializing Crashlytics 2.3.8.97
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .     |  | 
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .     |  |
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .     |  |
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .   \ |  | /
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .    \    /
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .     \  /
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .      \/
02-21 14:17:21.350 13313 13313 E CrashlyticsCore: .
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .      /\
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .     /  \
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .    /    \
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .   / |  | \
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .     |  |
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .     |  |
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .     |  |
02-21 14:17:21.351 13313 13313 E CrashlyticsCore: .
02-21 14:17:21.352 13313 13313 D AndroidRuntime: Shutting down VM
02-21 14:17:21.354 13313 13313 E UncaughtException: 
02-21 14:17:21.354 13313 13313 E UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{net.webikers.mobileapp/net.webikers.mobileapp.MainActivity}: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
02-21 14:17:21.354 13313 13313 E UncaughtException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.354 13313 13313 E UncaughtException: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.354 13313 13313 E UncaughtException: 
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.ActivityThread.-wrap11(ActivityThread.java)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.os.Handler.dispatchMessage(Handler.java:102)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.os.Looper.loop(Looper.java:148)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.ActivityThread.main(ActivityThread.java:5461)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at java.lang.reflect.Method.invoke(Native Method)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
02-21 14:17:21.354 13313 13313 E UncaughtException: Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
02-21 14:17:21.354 13313 13313 E UncaughtException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.354 13313 13313 E UncaughtException: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.354 13313 13313 E UncaughtException: 
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:288)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:236)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.Kit.initialize(Kit.java:66)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:439)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.Fabric.init(Fabric.java:383)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:340)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at io.fabric.sdk.android.Fabric.with(Fabric.java:311)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.sarriaroman.fabric.FabricPlugin.pluginInitialize(FabricPlugin.java:42)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:58)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.PluginManager.init(PluginManager.java:86)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:115)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at net.webikers.mobileapp.MainActivity.onCreate(MainActivity.java:39)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.Activity.performCreate(Activity.java:6251)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
02-21 14:17:21.354 13313 13313 E UncaughtException:     ... 9 more
02-21 14:17:21.354 13313 13313 E UncaughtException: Caused by: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
02-21 14:17:21.354 13313 13313 E UncaughtException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.354 13313 13313 E UncaughtException: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.354 13313 13313 E UncaughtException: 
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.crashlytics.android.core.BuildIdValidator.validate(BuildIdValidator.java:59)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.crashlytics.android.core.CrashlyticsCore.setAndValidateKitProperties(CrashlyticsCore.java:319)
02-21 14:17:21.354 13313 13313 E UncaughtException:     at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:262)
02-21 14:17:21.354 13313 13313 E UncaughtException:     ... 30 more
02-21 14:17:21.356 13313 13340 I FA      : Tag Manager is not found and thus will not be used
02-21 14:17:21.626 13313 13313 E AndroidRuntime: FATAL EXCEPTION: main
02-21 14:17:21.626 13313 13313 E AndroidRuntime: Process: net.webikers.mobileapp, PID: 13313
02-21 14:17:21.626 13313 13313 E AndroidRuntime: Theme: themes:{}
02-21 14:17:21.626 13313 13313 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{net.webikers.mobileapp/net.webikers.mobileapp.MainActivity}: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
02-21 14:17:21.626 13313 13313 E AndroidRuntime: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.626 13313 13313 E AndroidRuntime: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.626 13313 13313 E AndroidRuntime: 
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.ActivityThread.-wrap11(ActivityThread.java)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5461)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
02-21 14:17:21.626 13313 13313 E AndroidRuntime: Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
02-21 14:17:21.626 13313 13313 E AndroidRuntime: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.626 13313 13313 E AndroidRuntime: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.626 13313 13313 E AndroidRuntime: 
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:288)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:236)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.Kit.initialize(Kit.java:66)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:439)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.Fabric.init(Fabric.java:383)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:340)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at io.fabric.sdk.android.Fabric.with(Fabric.java:311)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.sarriaroman.fabric.FabricPlugin.pluginInitialize(FabricPlugin.java:42)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:58)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.PluginManager.init(PluginManager.java:86)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:115)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at net.webikers.mobileapp.MainActivity.onCreate(MainActivity.java:39)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:6251)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    ... 9 more
02-21 14:17:21.626 13313 13313 E AndroidRuntime: Caused by: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
02-21 14:17:21.626 13313 13313 E AndroidRuntime: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
02-21 14:17:21.626 13313 13313 E AndroidRuntime: install an Android build tool and ask a team member to invite you to this app's organization.
02-21 14:17:21.626 13313 13313 E AndroidRuntime: 
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.crashlytics.android.core.BuildIdValidator.validate(BuildIdValidator.java:59)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.crashlytics.android.core.CrashlyticsCore.setAndValidateKitProperties(CrashlyticsCore.java:319)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:262)
02-21 14:17:21.626 13313 13313 E AndroidRuntime:    ... 30 more
02-21 14:17:21.629   666   933 W ActivityManager:   Force finishing activity net.webikers.mobileapp/.MainActivity

The other plugins I'm using are:

"cordovaPlugins": [
    {
      "id": "cordova-plugin-facebook4",
      "locator": "cordova-plugin-facebook4@1.7.4",
      "variables": {
        "APP_ID": "XXXXXXXXXXXXXXX",
        "APP_NAME": "YYYYYYYYYY"
      }
    },
    "cordova-plugin-console@1.0.5",
    {
      "locator": "https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git#bd87605936b450dc32de0cddfb2ddb4936803fe0",
      "id": "cordova-plugin-datepicker"
    },
    "ionic-plugin-keyboard@2.2.1",
    "cordova-plugin-extension@1.5.1",
    "cordova-plugin-admobpro@2.25.2",
    "cordova-plugin-statusbar@2.2.1",
    "cordova-plugin-whitelist@1.3.1",
    {
      "locator": "https://github.com/kurtisf/cordova-plugin-restrict-keyboard#9076a8d16b2181910cd35910495413e5cc70218e",
      "id": "cordova-plugin-restrict-keyboard"
    },
    "cordova-plugin-device@1.1.4",
    "cordova-plugin-splashscreen@4.0.1",
    "cordova-plugin-geolocation@2.4.1",
    "cordova-plugin-compat@1.1.0",
    "cordova-plugin-network-information@1.3.1",
    "cordova-plugin-globalization@1.0.5",
    "cordova-plugin-inappbrowser@1.6.1",
    "cordova-plugin-file-transfer@1.6.1",
    "cordova-plugin-file@4.3.1",
    "cordova-plugin-android-permissions@0.10.0",
    "cordova-plugin-actionsheet@2.3.3",
    "uk.co.workingedge.phonegap.plugin.launchnavigator@3.2.1",
    "cordova-plugin-image-picker@1.1.1",
    "cordova-plugin-firebase@0.1.19",
    "cordova-plugin-velda-devicefeedback@0.0.2",
    "cordova-custom-config@3.1.2"
  ]

Any idea why this might be happening?

Thanks in advance

davidquon commented 7 years ago

I've had this issue too. I think it might be related to https://github.com/sarriaroman/FabricPlugin/pull/80. I haven't had a chance to verify it yet but I think this is a potential fix for the problem https://github.com/sarriaroman/FabricPlugin/pull/87.

The other work around that I was using was to uninstall and reinstall the plugin after the npm install which helped temporarily fix the problem for me (although not the root cause).

giordy commented 7 years ago

@davidquon I see, thanks for the prompt feedback!

sarriaroman commented 7 years ago

You will need to re-install the plugin. Latest version has the new Fabric plugin instead of Crashlytics.

manishoswal commented 7 years ago

@sarriaroman - I uninstalled and re-installed the plugin. I can see updated code in the gradle file but still getting same error.

manishoswal commented 7 years ago

@davidquon @giordy - Any luck with this, what i also observed is, release build has issues debug works fine .

kleeb commented 7 years ago

This happens using Phonegap Build. Packaging locally on Cordova builds properly.

PGB currently is not supporting hooks:

    <hook type="after_plugin_add" src="hooks/after_plugin_add.js" />
    <hook type="before_plugin_rm" src="hooks/before_plugin_rm.js" />

any way to get rid of them somehow and keep the project working?

giordy commented 7 years ago

@sarriaroman I should mention that the first version I had ever installed in the project was the latest, 1.1.7

sarriaroman commented 7 years ago

Sorry guys, sometimes I take vacations :). Honestly I don't have recent experience with Phonegap build but must be some kind of replacement for the hooks because are required and the problem is there.

RobertYoung commented 7 years ago

I am also having this problem but also in development mode.

I think this has something to do with the "src/android/build-extras.gradle" file.

In the main build.gradle, if I add the steps that Fabric modifies automatically from the Android Studio Fabric Tool and comment out: apply from: "cordova-fabric-plugin/myproject-build-extras.gradle" it works.

screen shot 2017-03-18 at 14 22 51

Can anyone else confirm this fixes it for them also?

ashbrener commented 7 years ago

@RobertYoung I was having the same issue and your fix worked for me. Does anyone have a more permanent solution?

sahildaga95 commented 7 years ago

Any updates on this issue ?

RobertYoung commented 7 years ago

Unfortunately not, however I have hacked it and so it is automated for the time being. I've added a cordova hook to amend the android files after the platform has been added.

/hooks/after_platform_add/010_install_fabric_android.js

#!/usr/bin/env node

console.log("> 010_install_fabric_android.js");

const fs = require('fs');
const gradleBundlePath = `./platforms/android/build.gradle`;
const gradleBundleEncoding = `utf8`;
const mainActivityPath = `./platforms/android/src/com/iamrobertyoung/settimes/MainActivity.java`;
const mainActivityEncoding = `utf8`;

function installFabricForAndroid() {
  if (!fs.existsSync(gradleBundlePath) || !fs.existsSync(mainActivityPath)) {
    console.warn(`Cannot find android related files`);
    return;
  };

  replaceGradleBundle();
  replaceMainActivity();
}

function replaceGradleBundle() {
  var gradleBundle = readGradleBundle();
  var newGradleBundle = gradleBundle.replace(`apply plugin: 'com.android.application'`, `
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}
  `)
    .replace(`repositories {
        mavenCentral()
        jcenter()
    }`,
    `repositories {
        mavenCentral()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }`)
    .replace(`dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
    }`,
    `dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }`)

  writeGradleBundle(newGradleBundle);
}

function replaceMainActivity() {
  var mainActivity = readMainActivity();
  var newMainActivity = mainActivity.replace(`import android.os.Bundle;`,
    `import android.os.Bundle;
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;`)
    .replace(`super.onCreate(savedInstanceState);`,
    `super.onCreate(savedInstanceState);
        Fabric.with(this, new Crashlytics());`);

  writeMainActivity(newMainActivity);
}

function readGradleBundle() {
  return fs.readFileSync(gradleBundlePath, gradleBundleEncoding);
}

function writeGradleBundle(bundle) {
  return fs.writeFileSync(gradleBundlePath, bundle);
}

function readMainActivity() {
  return fs.readFileSync(mainActivityPath, mainActivityEncoding);
}

function writeMainActivity(mainActivity) {
  return fs.writeFileSync(mainActivityPath, mainActivity);
}

installFabricForAndroid();

Yes this is dirty, and will most likely break, but it's a workaround.

emcniece commented 6 years ago

Just ran through this, was able to resolve by adding the assorted hook files then:

ionic cordova plugin rm cordova-fabric-plugin --save
ionic cordova platform rm android
ionic cordova platform rm ios

# Edited config.xml to add hooks:
# <hook src="hooks/after_plugin_add.js" type="after_plugin_add" />
# <hook src="hooks/before_plugin_rm.js" type="before_plugin_rm" />

ionic cordova platform add android
ionic cordova platform add ios
ionic cordova plugin add https://github.com/sarriaroman/FabricPlugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx --save

Somewhere in the middle of testing this sequence for reliability, I discovered that Android Studio couldn't find a bunch of Java classes on the Crashlytics framework - seems like maybe there was outdated code. This is what prompted me to remove the original cordova-fabric-plugin and reinstall from Github source (master branch).

I am now able to perform all builds by CLI:

ionic cordova build android
ionic cordova build android --release
ionic cordova build ios
ionic cordova build ios --release

... as well as build the project cleanly from XCode and Android Studio.

nmartin867 commented 6 years ago

@emcniece You rock! I have tried re-installing the plugin directly from GH but it didn't help. I think the hooks are key.

emcniece commented 6 years ago

@nmartin867 good to hear! Beware though, as noted by https://github.com/sarriaroman/FabricPlugin/issues/88#issuecomment-286214951 it looks like Phonegap doesn't run these hooks.

But if you're not using Phonegap... ¯\_(ツ)_/¯

I'm using https://fastlane.tools/ - builds happen locally.

marcllucia commented 6 years ago

solved using version 1.1.6

ionic cordova plugin add https://github.com/sarriaroman/FabricPlugin#1.1.6 --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx --save

nightwolf13 commented 6 years ago

Does it still not working on Phonegap build?... Looks like i have the same issue, as in the top of this topic..

pph7 commented 6 years ago

I have the same issue with version 1.1.7

emcniece commented 6 years ago

@pph7 do you see your Fabric API key/secret in config.xml?

<plugin name="cordova-fabric-plugin" spec="^1.1.9">
        <variable name="FABRIC_API_KEY" value="xxxxxxxxxxxxxxxxxxxx" />
        <variable name="FABRIC_API_SECRET" value=""xxxxxxxxxxxxxxxxxxxx" />
    </plugin>
pph7 commented 6 years ago

Yes, exactly like that.

mo7amd commented 6 years ago

any update on this issue.