cordova-ionic-phonegap-branch-deep-linking-attribution: Can't install plugin: Cannot read property '0' of undefined
Since yesterday (September 18) the plugin install doesn’t work, without having changed anything. I have a build pipeline with Gitlab CI. It’s using a Docker image with all the dependencies preinstalled (npm, cordova, ionic…). A build that was working 2 days ago, is now failing.
I also have the same error on a blank ionic project (ionic start MyIonicProject tutorial --type=ionic-angular)
My console output:
ionic cordova plugin add branch-cordova-sdk
cordova plugin add branch-cordova-sdk
You have been opted out of telemetry. To change this, run: cordova telemetry on.
Plugin "branch-cordova-sdk" already installed on android.
Adding branch-cordova-sdk to package.json
Cannot read property '0' of undefined
[ERROR] An error occurred while running subprocess cordova.
cordova plugin add branch-cordova-sdk exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I’m using:
- node 8.15.0
- npm 6.7.0
- ionic 5.2.3
- cordova 8.1.2
I also tried with
- node 8.15.0
- npm 6.11.3
- ionic 5.3.0
- cordova 9.0.0
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 6
- Comments: 16 (2 by maintainers)
This seems to be an issue with
cordova-android 8.1.0. It doesn’t seem to add the same records toAndroidManifest.xmlthat is used to and hence the branch-cordova-sdk cannot get theuses-sdktag and determine the target sdk version.When I specify the android version explicitly to an earlier version the problem no longer occurs i.e:
ionic cordova platform add android@8.0.0uses-sdkshould no longer be declared in the manifest, please check https://github.com/apache/cordova-android/issues/629Just keep in mind that the tradeoff is that as of version 4.0.0, you have to manually build from Xcode. https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/issues/601
Any update from the Branch team?
In the version npm i branch-cordova-sdk@^4.0.0 be omit the requese targetVersionSdk use this version
@noahcooper @Mapiac you should be able to use 3.2.1 which is now published, which fixes the issue for cordova-android in the branch plugin’s 3.x line.
If you’re using cordova 8/9 and build using xcode, you’ll want to use the 4.0 line. We know about the inability to build on the command line, it’s an issue the iOS team will take on at some point but requires significant reorganization of the native library so will take some time.
Any news?
I encountered the same error. 4 days back every thing is working but now ‘ionic cordova platform add android’ fails .