sarriaroman / FabricPlugin

Fabric.io plugin for Cordova or Phonegap
MIT License
197 stars 157 forks source link

Android release - UnmetDependencyException #91

Open rfeniak opened 7 years ago

rfeniak commented 7 years ago

Hi guys, I'm using your plugin and I've faced with following issue: When I build android debug application with "ionic build android" command all works fine, I can simulate crashes and see statistic in dashboard. But when I build app for production release with "ionic build android --release" I got following error: Unfortunately, "app name" has stopped. Via adb logcat I got error: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/signup

I was able to fix that issue by creation of additional file \mobile\platforms\android\res\values\com_crashlytics_export_strings.xml with following content:

`<?xml version="1.0" encoding="utf-8" standalone="no"?>

964B963A-E397-44CE-BEDD-207C42AB1D6C ` But it's very unuseful to do that after each "ionic state reset". Could you help me with this? Best regards, Roman
EralpB commented 7 years ago

Same problem, but I don't even understand the solution :/

pjorquera commented 7 years ago

Which Cordova version are you using? With Cordova 6.5.0 I can successfully use the Fabric plugin but when I moved my project to Cordova 7.0.1 there's a runtime exception of type UnmetDependencyException

IvanProdaiko94 commented 6 years ago

Any solutions or workaround found?

fryck commented 6 years ago

I can confirm that there is an issue with cordova-cli v7.1...

fryck commented 6 years ago

I've created a cordova hook (after_plugin_install) and it wortks now for cordova v7 :

#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var uuidV4 = require('uuid/v4');
var xml2js = require('xml2js');

module.exports = function crashlyticsExportStrings(context) {
  if (context.opts.plugin.id !== 'cordova-fabric-plugin') {
    return ;
  }
  var filePath = path.join(context.opts.projectRoot, 'platforms', 'android', 'res', 'values', 'com_crashlytics_export_strings.xml');
  var uuid = uuidV4();
  var builder = new xml2js.Builder({
    'xmldec' : {
      encoding: "utf-8",
      standalone: false
    }
  });
  var xml = builder.buildObject({
    resources: {
      string: { 
        $: {
          "xmlns:ns0": "http://schemas.android.com/tools",
          name: "com.crashlytics.android.build_id",
          "ns0:ignore": "UnusedResources,TypographyDashes",
          translatable: false
        },
        _: uuidV4()
      }
    }
  });
  fs.writeFileSync(filePath, xml, 'utf8');
};