ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.3k stars 1.01k forks source link

Help needed: CDVPlugin class ... (pluginName: ...) does not exist #1014

Closed leshik closed 4 years ago

leshik commented 6 years ago

I'm trying to make the cordova-ionic-phonegap-branch-deep-linking plugin work, but have some issues. After some trial & error I was able to make it compile, but it doesn't work with this error:

CDVPlugin class BranchSDK (pluginName: branchsdk) does not exist

@jcesarmobile @mlynch any idea where to look at to make it compatible with Capacitor?

jcesarmobile commented 6 years ago

I can't reproduce following your steps, after adding #import <Cordova/CDVPlugin.h> it compiles

But we can probably read pod tags to add them as dependencies, but would be better if the plugin author merged the PR you pointed where it uses Cordova way of doing it

leshik commented 6 years ago

@jcesarmobile I mean, I can compile it, but it doesn’t work for some reason – complains about missing class. I wonder if something might be wrong with cordova compatibility layer?

jcesarmobile commented 6 years ago

Sorry, I'm not familiar with the plugin and it requires registration, so I can't properly test it.

But I've checked and I can see branchsdk plugin in the registry, so not sure why it doesn't find it in your case.

leshik commented 6 years ago

It’s not even necessary to register to see the error (on iOS). As it uses onload property in config.xml, it throws the error to XCode console when loading the app.

jcesarmobile commented 6 years ago

yeah, as I said, I can see the plugin class properly registered. If I try to call initSession it crash because I'm not registered, but it's the plugin call what makes it crash, so the plugin is registered and received the initSession method call, not sure what happens in your project

leshik commented 6 years ago

@jcesarmobile Did you try it on a fresh project? I believe something weird is happening here, I can reproduce it 100% on a fresh project with 1.0.0-beta.11.

Here are my steps:

npx @capacitor/cli create
npm i --save branch-cordova-sdk

Open node_modules/branch-cordova-sdk/plugin.xml and edit it according to https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking/pull/527, just use 0.25.6 SDK version instead of 0.25.8.

npx cap add ios

Open

ios/capacitor-cordova-ios-plugins/sourcesstatic/BranchCordovaSdk/AppDelegate+BranchSdk.m

and add

#import <Cordova/CDVPlugin.h>

Then,

npx cap sync
npx cap open ios

Then build and run it in XCode. At this point, there are no errors, but also there are no plugins or Branch objects present in Safari JS console, which means something is wrong with the initialization. So I added another Cordova plugin that I use (cordova-plugin-speechrecognition), then rebuild and run. Now the error is here:

2018-11-29 08:54:17.923601+0700 App[20239:5291469] Registering Plugin CAPAccessibilityPlugin
2018-11-29 08:54:17.923660+0700 App[20239:5291469] Registering Plugin CAPAppPlugin
2018-11-29 08:54:17.923683+0700 App[20239:5291469] Registering Plugin CAPBackgroundTaskPlugin
2018-11-29 08:54:17.923724+0700 App[20239:5291469] Registering Plugin CAPBrowserPlugin
2018-11-29 08:54:17.923745+0700 App[20239:5291469] Registering Plugin CAPCameraPlugin
2018-11-29 08:54:17.923766+0700 App[20239:5291469] Registering Plugin CAPClipboardPlugin
2018-11-29 08:54:17.923785+0700 App[20239:5291469] Registering Plugin CAPConsolePlugin
2018-11-29 08:54:17.924183+0700 App[20239:5291469] Registering Plugin CAPDevicePlugin
2018-11-29 08:54:17.924210+0700 App[20239:5291469] Registering Plugin CAPFilesystemPlugin
2018-11-29 08:54:17.924231+0700 App[20239:5291469] Registering Plugin CAPGeolocationPlugin
2018-11-29 08:54:17.924251+0700 App[20239:5291469] Registering Plugin CAPHapticsPlugin
2018-11-29 08:54:17.924272+0700 App[20239:5291469] Registering Plugin CAPKeyboard
2018-11-29 08:54:17.924291+0700 App[20239:5291469] Registering Plugin CAPLocalNotificationsPlugin
2018-11-29 08:54:17.924393+0700 App[20239:5291469] Registering Plugin CAPModalsPlugin
2018-11-29 08:54:17.924546+0700 App[20239:5291469] Registering Plugin CAPNetworkPlugin
2018-11-29 08:54:17.924566+0700 App[20239:5291469] Registering Plugin CAPPushNotificationsPlugin
2018-11-29 08:54:17.924585+0700 App[20239:5291469] Registering Plugin CAPPhotosPlugin
2018-11-29 08:54:17.924607+0700 App[20239:5291469] Registering Plugin CAPSharePlugin
2018-11-29 08:54:17.924627+0700 App[20239:5291469] Registering Plugin CAPSplashScreenPlugin
2018-11-29 08:54:17.924658+0700 App[20239:5291469] Registering Plugin CAPStatusBarPlugin
2018-11-29 08:54:17.925009+0700 App[20239:5291469] Registering Plugin CAPStoragePlugin
2018-11-29 08:54:17.925037+0700 App[20239:5291469] Registering Plugin CAPToastPlugin
2018-11-29 08:54:17.925057+0700 App[20239:5291469] Registering Plugin CAPWebViewPlugin
2018-11-29 08:54:18.115965+0700 App[20239:5291469] CDVPlugin class BranchSDK (pluginName: branchsdk) does not exist.
---------------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Loading network plugin
⚡️  Loading app at capacitor://app...
Reachable via WiFi
APP ACTIVE
⚡️  [log] - onscript loading complete
⚡️  To Native ->  SplashScreen hide 13548337
⚡️  TO JS {}
⚡️  WebView loaded

I wonder why it doesn't initialize by itself (without other Cordova plugins), maybe the error I observe is related to this.

leshik commented 6 years ago

@jcesarmobile I was able to workaround it by manually adding BranchSDK.m to Build Phases -> Compile Sources, but I believe a better way exists...

image

jcesarmobile commented 5 years ago

I could reproduce following your steps.

I see what the problem is, when the plugin has a pod dependency I put it in a different project that gets converted to a static framework. For some reason (maybe CocoaPods bug?), the class is not available from the static framework. If it's not available, the plugins .js is not injected, that's why Branch is not available from js neither.

I did this because some pods were not working in non static project, and I couldn't find a way of knowing if it was going to work on the dynamic project or not, so I put all in the static one.

Knowing that it causes problems with the native classes, maybe we should forget about the static framework and just put all on the dynamic one, and if some plugin doesn't work because of that, just add it to the unsupported ones.

eternitybro commented 5 years ago

I'm using ionic v4 I'm also receiving a runtime error from XCode:

CDVPlugin class BranchSDK (pluginName: branchsdk) does not exist.
CDVPlugin class BranchSDK (pluginName: BranchSDK) does not exist.
2019-02-05 14:34:49.603140-0600 Making Scents[33499:8488466] ERROR: Plugin 'BranchSDK' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2019-02-05 14:34:49.603174-0600 Making Scents[33499:8488466] FAILED pluginJSON = ["BranchSDK356496177","BranchSDK","createBranchUniversalObject",[{"contentDescription":"Checkout my creation yes on Making Scents","title":"I made scents...","canonicalIdentifier":"content\/123","canonicalUrl":"https:\/\/example.com\/content\/123","contentIndexingMode":"private","contentMetadata":{"formulaPath":"formulae\/ZLgKTone4KPkqw4nw78P\/revisions\/YcgGeEvvnr1fJTwMlQrU"}}]]

Everything compiles fine but none of the branch functions work.

I've tried adding the plugin only in config.xml (as specified in the docs).

I've also tried using

ionic cordova plugin add branch-cordova-sdk
npm install @ionic-native/branch-io@4

as specified in the Ionic docs and npm install @ionic-native/branch-io@latest and npm install @ionic-native/branch-io

Everytime I've removed and added the ios platform.

ionic cordova platform remove ios
ionic cordova platform add ios
ionic cordova platform prepare ios

I still get this runtime error.

I've tried using: import { BranchIo } from '@ionic-native/branch-io/ngx' with

public branch: BranchIo;
...
this.branch.initSession().then(data => {

vs

declare var Branch
...
Branch =  Branch || (<any>window).Branch;
Branch.initSession().then(data => {

I'm worried about manually copying files over to XCode because if I add/remove the platform in the future I'll have to keep copying over a hack.

Here's my config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.keepmakingscents" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Making Scents</name>
    <description>Create, experience, share.</description>
    <author email="rob@robgungor.com" href="https://robgungor.com/">Rob Gungor</author>
    <content src="index.html" />
    <access origin="*" />
    <access origin="*facebook.com*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="AutohideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="30000" />
    <preference name="KeyboardResize" value="true" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-facebook4" spec="4.1.0">
        <variable name="APP_ID" value="XXX" />
        <variable name="APP_NAME" value="makingScents" />
    </plugin>
    <branch-config>
        <branch-key value="key_live_XXX" />
        <uri-scheme value="makingscents" />
        <link-domain value="makingscents.app.link" />
        <ios-team-release value="XXX" />
    </branch-config>
    <plugin name="cordova-plugin-ionic-webview" spec="^2.3.2" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-taptic-engine" spec="2.1.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="2.1.3" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <preference name="SplashScreen" value="screen" />
    <plugin name="branch-cordova-sdk" spec="3.1.5" />
    <engine name="ios" spec="4.5.5" />
</widget>

Hellllllp!

lucasnguyen3979 commented 5 years ago

I'm using ionic v4 I'm also receiving a runtime error from XCode:

CDVPlugin class BranchSDK (pluginName: branchsdk) does not exist.
CDVPlugin class BranchSDK (pluginName: BranchSDK) does not exist.
2019-02-05 14:34:49.603140-0600 Making Scents[33499:8488466] ERROR: Plugin 'BranchSDK' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2019-02-05 14:34:49.603174-0600 Making Scents[33499:8488466] FAILED pluginJSON = ["BranchSDK356496177","BranchSDK","createBranchUniversalObject",[{"contentDescription":"Checkout my creation yes on Making Scents","title":"I made scents...","canonicalIdentifier":"content\/123","canonicalUrl":"https:\/\/example.com\/content\/123","contentIndexingMode":"private","contentMetadata":{"formulaPath":"formulae\/ZLgKTone4KPkqw4nw78P\/revisions\/YcgGeEvvnr1fJTwMlQrU"}}]]

Everything compiles fine but none of the branch functions work.

I've tried adding the plugin only in config.xml (as specified in the docs).

I've also tried using

ionic cordova plugin add branch-cordova-sdk
npm install @ionic-native/branch-io@4

as specified in the Ionic docs and npm install @ionic-native/branch-io@latest and npm install @ionic-native/branch-io

Everytime I've removed and added the ios platform.

ionic cordova platform remove ios
ionic cordova platform add ios
ionic cordova platform prepare ios

I still get this runtime error.

I've tried using: import { BranchIo } from '@ionic-native/branch-io/ngx' with

public branch: BranchIo;
...
this.branch.initSession().then(data => {

vs

declare var Branch
...
Branch =  Branch || (<any>window).Branch;
Branch.initSession().then(data => {

I'm worried about manually copying files over to XCode because if I add/remove the platform in the future I'll have to keep copying over a hack.

Here's my config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.keepmakingscents" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Making Scents</name>
    <description>Create, experience, share.</description>
    <author email="rob@robgungor.com" href="https://robgungor.com/">Rob Gungor</author>
    <content src="index.html" />
    <access origin="*" />
    <access origin="*facebook.com*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="AutohideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="30000" />
    <preference name="KeyboardResize" value="true" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-facebook4" spec="4.1.0">
        <variable name="APP_ID" value="XXX" />
        <variable name="APP_NAME" value="makingScents" />
    </plugin>
    <branch-config>
        <branch-key value="key_live_XXX" />
        <uri-scheme value="makingscents" />
        <link-domain value="makingscents.app.link" />
        <ios-team-release value="XXX" />
    </branch-config>
    <plugin name="cordova-plugin-ionic-webview" spec="^2.3.2" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-taptic-engine" spec="2.1.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="2.1.3" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <preference name="SplashScreen" value="screen" />
    <plugin name="branch-cordova-sdk" spec="3.1.5" />
    <engine name="ios" spec="4.5.5" />
</widget>

Hellllllp!

I also met an exact same issue like that with Twitter Connect on Ionic v4 (https://ionicframework.com/docs/native/twitter-connect).

My package.json

{
  "name": "google",
  "description": "Google-Team",
  "version": "0.0.1",
  "author": "Google Software",
  "homepage": "https://www.google.com/",
  "scripts": {
    "ng": "ng",
    "start": "ionic serve -l",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.9",
    "@angular/common": "^7.2.9",
    "@angular/core": "^7.2.9",
    "@angular/fire": "^5.1.1",
    "@angular/forms": "^7.2.9",
    "@angular/http": "^7.2.9",
    "@angular/platform-browser": "^7.2.9",
    "@angular/platform-browser-dynamic": "^7.2.9",
    "@angular/router": "^7.2.9",
    "@aspnet/signalr": "^1.1.4",
    "@ionic-native/app-version": "^5.5.0",
    "@ionic-native/barcode-scanner": "^5.3.0",
    "@ionic-native/core": "^5.3.0",
    "@ionic-native/facebook": "^5.10.0",
    "@ionic-native/fcm": "^5.10.0",
    "@ionic-native/fingerprint-aio": "^5.5.1",
    "@ionic-native/firebase": "^5.4.0",
    "@ionic-native/google-plus": "^5.10.0",
    "@ionic-native/in-app-browser": "^5.5.1",
    "@ionic-native/keyboard": "^5.10.0",
    "@ionic-native/network": "^5.4.0",
    "@ionic-native/qr-scanner": "^5.3.0",
    "@ionic-native/splash-screen": "5.3.0",
    "@ionic-native/status-bar": "^5.2.0",
    "@ionic-native/twitter-connect": "^5.11.0",
    "@ionic/angular": "4.1.1",
    "@ionic/storage": "^2.2.0",
    "@logisticinfotech/ionic4-datepicker": "^1.3.0",
    "@ngrx/effects": "^7.3.0",
    "@ngrx/store": "^7.3.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "4.0.0",
    "cordova-android": "^7.1.4",
    "cordova-ios": "4.5.5",
    "cordova-lib": "^9.0.1",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-androidx": "1.0.2",
    "cordova-plugin-androidx-adapter": "1.1.0",
    "cordova-plugin-app-version": "^0.1.9",
    "cordova-plugin-browsertab": "0.2.0",
    "cordova-plugin-buildinfo": "2.0.3",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-customurlscheme": "4.4.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-facebook4": "5.0.0",
    "cordova-plugin-fcm-with-dependecy-updated": "^2.4.0",
    "cordova-plugin-fingerprint-aio": "^1.7.0",
    "cordova-plugin-googleplus": "^5.3.2",
    "cordova-plugin-inappbrowser": "^3.1.0",
    "cordova-plugin-ionic-keyboard": "2.1.3",
    "cordova-plugin-ionic-webview": "4.1.0",
    "cordova-plugin-network-information": "^2.0.2",
    "cordova-plugin-qrscanner": "3.0.1",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "core-js": "^2.6.5",
    "crypto-js": "^3.1.9-1",
    "d3": "^5.9.2",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^5.8.6",
    "hammerjs": "^2.0.8",
    "ionic-plugin-keyboard": "^2.2.1",
    "moment": "^2.24.0",
    "ngx-qrcode2": "0.0.9",
    "rxjs": "6.4.0",
    "twitter-connect-plugin": "git+https://github.com/chroa/twitter-connect-plugin.git",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.13.6",
    "@angular-devkit/build-angular": "^0.13.6",
    "@angular-devkit/core": "^7.3.6",
    "@angular-devkit/schematics": "^7.3.6",
    "@angular/cli": "^7.3.6",
    "@angular/compiler": "^7.2.9",
    "@angular/compiler-cli": "^7.2.9",
    "@angular/language-service": "^7.2.9",
    "@biesbjerg/ngx-translate-extract": "^2.3.4",
    "@ionic/angular-toolkit": "^1.4.1",
    "@ionic/lab": "^1.0.24",
    "@types/jasmine": "^3.3.12",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^11.11.4",
    "codelyzer": "~5.0.0-beta.1",
    "cypress": "^3.2.0",
    "jasmine-core": "~3.3.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.5",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "po2json": "^1.0.0-alpha",
    "protractor": "~5.4.2",
    "ts-node": "~8.0.3",
    "tslint": "~5.14.0",
    "typescript": "3.2.4"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-qrscanner": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-app-version": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-androidx": {},
      "cordova-plugin-androidx-adapter": {},
      "cordova-plugin-browsertab": {},
      "cordova-plugin-buildinfo": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "XXX",
        "APP_NAME": "XXX",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "5.0.2"
      },
      "cordova-plugin-fingerprint-aio": {
        "FACEID_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-add-swift-support": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-fcm-with-dependecy-updated": {},
      "cordova-plugin-googleplus": {
        "REVERSED_CLIENT_ID": "XXX",
        "WEB_APPLICATION_CLIENT_ID": "XXX"
      },
      "twitter-connect-plugin": {
        "FABRIC_KEY": "XXX",
        "TWITTER_KEY": "XXX",
        "TWITTER_SECRET": "XXX"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

And my config.xml

<widget android-versionCode="1" id="com.etp.googlexxx" ios-CFBundleVersion="1" version="0.5.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Google Team</name>
    <description>Google /description>
    <author email="info@google.comhref="https://www.google.ccom/">Google Team</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-navigation href="*" />
    <preference name="deployment-target" value="7.0" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="Orientation" value="portrait" />
    <preference name="OverrideUserAgent" value="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <allow-navigation href="*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <preference name="UseSwiftLanguageVersion" value="4.0" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
    <plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.3" />
    <plugin name="cordova-plugin-network-information" spec="^2.0.2" />
    <plugin name="cordova-plugin-app-version" spec="^0.1.9" />
    <plugin name="cordova-plugin-inappbrowser" spec="^3.1.0" />
    <plugin name="cordova-plugin-browsertab" spec="0.2.0" />
    <plugin name="cordova-plugin-buildinfo" spec="2.0.3" />
    <plugin name="cordova-plugin-facebook4" spec="5.0.0">
        <variable name="APP_ID" value="XXX" />
        <variable name="APP_NAME" value="XXX" />
        <variable name="FACEBOOK_HYBRID_APP_EVENTS" value="false" />
        <variable name="FACEBOOK_ANDROID_SDK_VERSION" value="5.0.2" />
    </plugin>
    <plugin name="cordova-plugin-fingerprint-aio" spec="^1.7.0">
        <variable name="FACEID_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-add-swift-support" spec="^2.0.2" />
    <plugin name="cordova-plugin-fcm-with-dependecy-updated" spec="^2.4.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="2.1.3" />
    <plugin name="cordova-plugin-qrscanner" spec="3.0.1" />
    <plugin name="cordova-plugin-ionic-webview" spec="4.1.0">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-googleplus" spec="^5.3.2">
        <variable name="REVERSED_CLIENT_ID" value="XXX" />
        <variable name="WEB_APPLICATION_CLIENT_ID" value="XXX" />
    </plugin>
    <preference name="TwitterConsumerKey" value="XXX" />
    <preference name="TwitterConsumerSecret" value="XXX" />
    <plugin name="twitter-connect-plugin" spec="https://github.com/chroa/twitter-connect-plugin">
        <variable name="FABRIC_KEY" value="XXX" />
        <variable name="TWITTER_KEY" value="XXX" />
        <variable name="TWITTER_SECRET" value="XXX" />
    </plugin>
    <engine name="ios" spec="4.5.5" />
    <engine name="android" spec="^7.1.4" />
</widget>
Taylorsuk commented 5 years ago

Hi Team, is there any update on Branch compatibility? I am getting the following on an iOS build.

...AppDelegate+BranchSdk.m:24:97: Declaration of 'CDVPluginHandleOpenURLNotification' must be imported from module 'Cordova.CDVPlugin' before it is required
jsheetzati commented 5 years ago

I am seeing a similar message using cordova-plugin-strpnt. CDVPlugin class StarPRNT (pluginName: starprnt) does not exist..

Is there a way to determine why Capacitor is unable to use certain plugins? The project builds fine but CDVPluginManager is unable to find the plugin in getCommandInstance. It is difficult knowing if this is a problem with my Xcode setup or a problem with a particular Cordova plugin. Are there any troubleshooting steps when Capacitor cannot find a Cordova plugin? A guide may be helpful to diagnose some of these issues ourselves.

jcesarmobile commented 5 years ago

report plugin issues independently so they can be tracked and looked into

codinronan commented 4 years ago

Hi guys just following up on this. We've been asked by the Branch team to look into this issue and indeed I ran into the same problem. I have the fix working locally with an updated version of the Branch cordova plugin (yes using Cordova!) so we will be pushing this shortly to release a new version.

Probably longer term we'll move to a proper Capacitor plugin but for now the Cordova one is working.

By the way, I'm not 100% certain of this but almost that sure, the reason I can get it to work now is due to CocaoPods 1.8 -- several changes in how that version manages dependencies allow files to resolve that couldn't before.

Anyway go ahead and follow this over at the branch repository. https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/pull/613

jcesarmobile commented 4 years ago

Yeah, I confirm the "CDVPlugin class (pluginName: ) does not exist" problem gets fixed when using CocoaPods 1.8.x

Glad to hear you have the plugin working on Capacitor.

Going to close since the original problem was a CocoaPods problem and the plugin will be compatible soon.

Also, I've seen there is an unofficial Capacitor plugin https://github.com/boundstate/capacitor-branch-deep-links

dkk commented 4 years ago

FYI: I'm on CocoaPods 1.8.4 and got CDVPlugin class CDVUIInAppBrowser (pluginName: uiinappbrowser) does not exist.. Generatic my project with KapselSDK3.2SP01PL2.

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.