BranchMetrics / cordova-ionic-phonegap-branch-deep-linking-attribution

The Branch Cordova Ionic Phonegap SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://docs.branch.io/apps/cordova-phonegap-ionic/
MIT License
233 stars 144 forks source link

Can't get Branch-cordova-sdk install -- Ionic #570

Open newuser44 opened 5 years ago

newuser44 commented 5 years ago

Branch cordova is in the config.xml file.
Got to setup iOS. Have a script the installs node_moduals and then removes and adds ios.
During this process it fails.


Using cordova-fetch for cordova-ios@~4.5.4

Adding ios project...

Creating Cordova project for the iOS platform:

    Path: platforms/ios
    Package: com.cool.app.test
    Name: Cool App
iOS project created with cordova-ios@4.5.5

Installing "branch-cordova-sdk" for ios

Failed to install 'branch-cordova-sdk': Error: Cannot find module 'xml2js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /Users/sbrothers/work/release3.8/apps/coolapp/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js:5:18
    at Object.<anonymous> (/Users/sbrothers/work/release3.8/apps/coolapp/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js:49:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

(node:719) UnhandledPromiseRejectionWarning: Error: Cannot find module 'xml2js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /Users/sbrothers/work/release3.8/apps/coolapp/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js:5:18
    at Object.<anonymous> (/Users/sbrothers/work/release3.8/apps/coolapp/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js:49:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
(node:719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I remove the plugin cordova plugin remove branch-cordova-sdk

Re-setup node_modals and iOS Everything is fine.

Install branch-cordovan again. This works now

Installing "branch-cordova-sdk" for ios
Adding branch-cordova-sdk to package.json
Saved plugin info for "branch-cordova-sdk" to config.xml

Go to build iOS (legacy way)

Fails TypeError: Cannot read property 'flags' of undefined I don't think this is related to branch-cordovan but the only way to fix it is re-install node modules. And the loop continues.

Failed to install 'branch-cordova-sdk': Error: Cannot find module 'xml2js'

newuser44 commented 4 years ago

Any luck with this. Getting this now.

cordova platform add ios@5 Using cordova-fetch for cordova-ios@5 Adding ios project... Creating Cordova project for the iOS platform: Path: platforms/ios Package: CompanyApp Name: CompanyApp iOS project created with cordova-ios@5.1.1 Installing "branch-cordova-sdk" for ios Failed to install 'branch-cordova-sdk': Error: Cannot find module 'xml2js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18)

After removing was able to install iOS.

Trying to add Branch back in. Get another error.

cordova plugin add branch-cordova-sdk Installing "branch-cordova-sdk" for ios Unable to load PlatformApi from platform. Error: Cannot find module 'unorm' Failed to install 'branch-cordova-sdk': Error: Unhandled "error" event. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)

After some back and forth. Trying to install branch again.

Failed to install 'branch-cordova-sdk': Error: Cannot find module './src/superspawn'