Capacitor: [error] Analyzing dependencies

Created on 21 Sep 2018  ·  7Comments  ·  Source: ionic-team/capacitor

When trying to run the iOS project I run into the issue of Error: Sandbox not in sync with the Podfile.lock while trying to run npx cap update ios I got the following message :
[!] The 'Pods-App' target has frameworks with conflicting names: firebaseanalytics.framework, firebasecore.framework, firebaseinstanceid.framework, firebasemessaging.framework, and googleutilities.framework.

Using following package.json:

"dependencies": {
    "@angular/animations": "^6.1.7",
    "@angular/common": "~6.1.1",
    "@angular/core": "~6.1.1",
    "@angular/fire": "^5.0.0",
    "@angular/forms": "~6.1.1",
    "@angular/http": "~6.1.1",
    "@angular/platform-browser": "~6.1.1",
    "@angular/platform-browser-dynamic": "~6.1.1",
    "@angular/router": "~6.1.1",
    "@auth0/angular-jwt": "^1.0.0",
    "@capacitor/cli": "1.0.0-beta.7",
    "@capacitor/core": "1.0.0-beta.7",
    "@capacitor/ios": "^1.0.0-beta.7",
    "@ionic-native/camera": "^5.0.0-beta.20",
    "@ionic-native/core": "^5.0.0-beta.20",
    "@ionic-native/document-viewer": "^5.0.0-beta.20",
    "@ionic-native/fcm": "^5.0.0-beta.20",
    "@ionic-native/file": "^5.0.0-beta.20",
    "@ionic-native/file-opener": "^5.0.0-beta.20",
    "@ionic-native/file-transfer": "^5.0.0-beta.20",
    "@ionic-native/firebase": "^5.0.0-beta.20",
    "@ionic-native/image-picker": "^5.0.0-beta.20",
    "@ionic-native/in-app-browser": "^5.0.0-beta.20",
    "@ionic-native/keyboard": "^5.0.0-beta.20",
    "@ionic-native/ms-adal": "^5.0.0-beta.20",
    "@ionic-native/splash-screen": "^5.0.0-beta.20",
    "@ionic-native/status-bar": "^5.0.0-beta.20",
    "@ionic/angular": "4.0.0-beta.7",
    "@ionic/pro": "1.0.20",
    "@ionic/storage": "^2.1.3",
    "@microsoft/microsoft-graph-client": "^1.0.0",
    "@microsoft/microsoft-graph-types": "^1.3.0",
    "animate.css": "^3.6.1",
    "com.synconset.imagepicker": "^2.1.10",
    "cordova-android": "6.4.0",
    "cordova-browser": "5.0.3",
    "cordova-ios": "4.5.5",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-document-viewer": "^0.9.10",
    "cordova-plugin-fcm": "^2.1.2",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-firebase": "^2.0.2",
    "cordova-plugin-inappbrowser": "^3.0.0",
    "cordova-plugin-ionic-keyboard": "^2.1.2",
    "cordova-plugin-ionic-webview": "^2.1.4",
    "cordova-plugin-keyboard": "^1.2.0",
    "cordova-plugin-ms-adal": "^0.10.1",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-telerik-imagepicker": "^2.1.10",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.4.0",
    "core-js": "^2.5.3",
    "css-animator": "^2.3.0",
    "devicon": "^2.0.0",
    "firebase": "~5.5.0",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "iso": "^5.2.0",
    "moment": "^2.22.2",
    "ng-elastic": "^1.0.0-beta.3",
    "ngx-pipes": "^2.1.7",
    "rxjs": "^6.2.2",
    "rxjs-compat": "^6.2.2",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.7.2",
    "@angular-devkit/build-angular": "~0.7.2",
    "@angular-devkit/core": "~0.7.2",
    "@angular-devkit/schematics": "~0.7.2",
    "@angular/cli": "~6.1.1",
    "@angular/compiler": "~6.1.1",
    "@angular/compiler-cli": "~6.1.1",
    "@angular/language-service": "~6.1.1",
    "@ionic/ng-toolkit": "^1.0.0",
    "@ionic/schematics-angular": "^1.0.0",
    "@ionic/v4-migration-tslint": "^1.5.1",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~10.9.2",
    "codelyzer": "~4.4.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~2.9.2"
  },
  "description": "The Future Group app",
  "cordova": {
    "plugins": {
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-keyboard": {},
      "com.synconset.imagepicker": {
        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "To upload profile photo"
      },
      "cordova-plugin-firebase": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-document-viewer": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-file-opener2": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ms-adal": {}
    },
    "platforms": [
      "android",
      "browser",
      "ios"
    ]
  }

repro to reproduce : https://github.com/webscaledev/future-backend/tree/ionic4/futureApp

known incompatible cordova plugin

Most helpful comment

Hi, is there an existing capacitor plugin for remote config?

All 7 comments

I have run into a similar issue today, but when trying to install plugin cordova-plugin-firebase.

This was the first Cordova plugin to install on my project, and it added all the dependencies from capacitor-cordova-ios-plugins podspec file, including Fabric and Crashlytics frameworks, and voila the same kind of error you had..

Then if I tried to remove Fabric and Crashlytics from podfile then I don't know how to use the versions provided by with capacitor-cordova-ios-plugins in AppDelegate to init Fabric and Crashlytics.

Indeed cordova-plugin-firebase seems to be the culprit. When I remove that I can build the app. However when I now try to run it I get :

[error] - ERROR Error: StaticInjectorError(AppModule)[AppComponent -> Platform]: 
  StaticInjectorError(Platform: core)[AppComponent -> Platform]: 
    NullInjectorError: No provider for Platform!
⚡️  [error] - ERROR CONTEXT [object Object]
⚡️  [log] - Error: StaticInjectorError(AppModule

My app.component.ts

import { Component } from "@angular/core";

import { Platform } from "@ionic/angular";
// import { SplashScreen } from "@ionic-native/splash-screen/ngx";
import { Plugins } from "@capacitor/core";
const { SplashScreen } = Plugins;

SplashScreen.hide();

import { StatusBar } from "@ionic-native/status-bar/ngx";
import { AngularFireMessaging } from "@angular/fire/messaging";

@Component({
  selector: "app-root",
  templateUrl: "app.component.html"
})
export class AppComponent {
  constructor(
    private platform: Platform,
    // private splashScreen: SplashScreen,
    private statusBar: StatusBar,
    private afMessaging: AngularFireMessaging
  ) {
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      // this.splashScreen.hide();
    });
  }

  requestPermission() {
    this.afMessaging.requestToken.subscribe(
      token => {
        console.log("Permission granted! Save to the server!", token);
      },
      error => {
        console.error(error);
      }
    );
  }
}

This is an incompatibility between cordova-plugin-firebase and cordova-plugin-fcm as both add the google/firebase frameworks as custom frameworks instead of using CocoaPods (as recommended by google).
Those frameworks have the same names and also there is a class with the same name and that causes problems.
I've modified the CLI to only copy the first framework it finds with the same name. That fixes the problem, but then cordova-plugin-firebase doesn't compile because only the cordova-plugin-fcm frameworks are copied and they are very old (2 year vs 1 month), so some methods didn't exist by then. So I won't commit that changes.

So I would suggest to remove cordova-plugin-fcm as it's frameworks are very old and doesn't seem to be maintained anymore.

Hi, is there an existing capacitor plugin for remote config?

Hi, is there an existing capacitor plugin for remote config?

Yes, you can use cordova-plugin-firebasex, it works fine for me with Ionic 5 and Capacitor.

Cheers
Unkn0wn0x

Was this page helpful?
0 / 5 - 0 ratings