Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy ionic 3 app build problems with branch-cordova-sdk #654

Open
newuser44 opened this issue May 8, 2020 · 3 comments
Open

Legacy ionic 3 app build problems with branch-cordova-sdk #654

newuser44 opened this issue May 8, 2020 · 3 comments

Comments

@newuser44
Copy link

newuser44 commented May 8, 2020

Been having this problem for weeks now.
A legacy app that is on ionic 3. Have updated to cordova iOS 5. Could be other programs that our outdated too?
Been trying to get things to build with

Trying to do fresh set up.

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: com.app-MWA-Carrier.test
	Name: CarrierControl
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)
    at /Users/sbrothers/work/appRelease/mobileapps/carrier-control/plugins/branch-cordova-sdk/src/scripts/lib/xmlHelper.js:5:18

Each time I try something else I get a different error. I'll keep posting what I find.
I think my next step is to remove branch.

UPDATE
Remove branch plugin, can get iOS to build. Things are working correctly.
Add to config.xml

Build again different error.

cordova build ios --buildFlag=-UseModernBuildSystem=0
Discovered plugin "branch-cordova-sdk" in config.xml. Adding it to the project
Installing "branch-cordova-sdk" for browser
Installing "branch-cordova-sdk" for ios
Failed to install 'branch-cordova-sdk': Error: Cannot find module './src/superspawn'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at Object.get (/Users/sbrothers/work/appRelease/mobileapps/node_modules/cordova-common/src/util/addProperty.js:26:44)
    at Object.<anonymous> (/Users/sbrothers/work/appRelease/mobileapps/carrier-control/platforms/ios/cordova/lib/Podfile.js:26:43)
    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)
    at Function.Module._load (module.js:497:3)
Failed to restore plugin "branch-cordova-sdk" from config.xml. You might need to try adding it again. Error: Error: Cannot find module './src/superspawn'

The plugin does show up in the plugin folder.
Try to build again.

Building for DIT
> ionic-app-scripts build --prod --target cordova --platform ios --buildFlag=-UseModernBuildSystem=0
module.js:549
    throw err;
    ^

Error: Cannot find module 'graceful-fs'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)

Build is all screwed up. Have to start over adding and removing iOS to fix this.

What is going on?

Update again.
Add and remove Branch plugin from command line.
Got error below. Even tried it all again using the @4 flag. I think both times its downloading the latest.

Do my build. Getting this in the log

/Users/sbrothers/work/appRelease/mobileapps/carrier-control/platforms/ios/ CarrierControl/Plugins/branch-cordova-sdk/AppDelegate+BranchSdk.m:6:9: fatal error: 
      'Branch.h' file not found
#import "Branch.h"
        ^~~~~~~~~~
1 error generated.
@Sroose
Copy link

Sroose commented May 25, 2020

Same here on Ionic4

In file included from xxx/Plugins/branch-cordova-sdk/BranchSDK.m:1:
xxx/Plugins/branch-cordova-sdk/BranchSDK.h:4:9: fatal error: 'Branch.h' file not found
#import "Branch.h"
        ^~~~~~~~~~
1 error generated.

@newuser44
Copy link
Author

Any update? Getting the same problem and searching the web for a solution. Google brings me back to my own problem from months ago.

Adding platfrom iOS auto address all the plugins which seems to cause a problem for Branch io.
Please advice?

@Sroose
Copy link

Sroose commented Aug 2, 2020

Duplicate of #642
@newuser44 you can find my workaround there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants