Have been getting this error when I try to build with CLI. i am using the new -cli version from the other issue. This was doing this on the previous version as well however.
cordova build --device --debugu
cordova-plugin-firebasex: Preparing Firebase on iOS
LD_RUNPATH_SEARCH_PATHS.substr is not a function
Not sure what this is about.
Removed platform ios and re-added
cd platforms/ios
pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 9 dependencies from the Podfile and 34 total pods installed.
[!] The Oil Analysis [Debug] target overrides the LD_RUNPATH_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-Oil Analysis/Pods-Oil Analysis.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the$(inherited)` flag, or
- Remove the build settings from the target.
[!] The Oil Analysis [Release] target overrides the LD_RUNPATH_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-Oil Analysis/Pods-Oil Analysis.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the$(inherited)` flag, or
- Remove the build settings from the target.
wc-mavic:ios michaeldemutis$
Ah, wait yes I can see that it does
I removed platform ios and re-added and it seems to be ok now. Can also build from cli no problem. I'm using cordova ios 5.1.1. Not sure if that is the latest version but that's what it installed.
I will have a look and see if I can see the cause
It's building fine from cli now so not sure what was happening. Removing the ios platform then re-adding seems to work.
I can't reproduce this issue so will close this for now but if you encounter it again let me know
Its an issue with platform cordova-ios v6, removing and adding the platform as 5.1.1 fixes the issue
cordova platform remove ios
cordova platform add [email protected]
this is what i see.
cordova-ios v5.1.0 returns a string for LD_RUNPATH_SEARCH_PATHS as
"@executable_path/Frameworks"
cordova-ios v6.0.0 returns an array of string now as
"@executable_path/Frameworks","$(inherited)"
The following function expected this variable to be a string and hence the substr failed. Modifying the following function in file /plugins/cordova-plugin-firebasex/scripts/ios/helper.js fixes it.
function addRunpathSearchBuildProperty(proj, build) {
const LD_RUNPATH_SEARCH_PATHS = proj.getBuildProperty("LD_RUNPATH_SEARCH_PATHS", build);
if (!LD_RUNPATH_SEARCH_PATHS) {
proj.addBuildProperty("LD_RUNPATH_SEARCH_PATHS", "\"$(inherited) @executable_path/Frameworks\"", build);
}
// Following code is to handle arrays.
if (Array.isArray(LD_RUNPATH_SEARCH_PATHS)) {
LD_RUNPATH_SEARCH_PATHS.forEach(eachpath => {
if (eachpath.indexOf("@executable_path/Frameworks") == -1) {
var newValue = eachpath.substr(0, LD_RUNPATH_SEARCH_PATHS.length - 1);
newValue += ' @executable_path/Frameworks\"';
proj.updateBuildProperty("LD_RUNPATH_SEARCH_PATHS", newValue, build);
}
if (eachpath.indexOf("$(inherited)") == -1) {
var newValue = eachpath.substr(0, LD_RUNPATH_SEARCH_PATHS.length - 1);
newValue += ' $(inherited)\"';
proj.updateBuildProperty("LD_RUNPATH_SEARCH_PATHS", newValue, build);
}
});
}
else{
// Assuming is a string
if (LD_RUNPATH_SEARCH_PATHS.indexOf("@executable_path/Frameworks") == -1) {
var newValue = LD_RUNPATH_SEARCH_PATHS.substr(0, LD_RUNPATH_SEARCH_PATHS.length - 1);
newValue += ' @executable_path/Frameworks\"';
proj.updateBuildProperty("LD_RUNPATH_SEARCH_PATHS", newValue, build);
}
if (LD_RUNPATH_SEARCH_PATHS.indexOf("$(inherited)") == -1) {
var newValue = LD_RUNPATH_SEARCH_PATHS.substr(0, LD_RUNPATH_SEARCH_PATHS.length - 1);
newValue += ' $(inherited)\"';
proj.updateBuildProperty("LD_RUNPATH_SEARCH_PATHS", newValue, build);
}
}
}
I can repro this with [email protected]
I still have this issue with [email protected] and [email protected]
The project can be built only once after platform adding and the next time it gives this error "LD_RUNPATH_SEARCH_PATHS.substr is not a function".
@vladsms use cordova ios 5.1.1
Has this been released? I'm in dependency hell at the moment.
@vladsms use cordova ios 5.1.1
I am using iOS 5.1.1 platform, but I still have this problem ... I am using cordova 10.0 Plugin version [email protected], tried iOS 5.1.1, 5.1.0, 5.0.0, 6.1. 1, 6.1.0, 6.0.0 - everywhere the same problem (((
@vladsms use cordova ios 5.1.1
I am using iOS 5.1.1 platform, but I still have this problem ... I am using cordova 10.0 Plugin version [email protected], tried iOS 5.1.1, 5.1.0, 5.0.0, 6.1. 1, 6.1.0, 6.0.0 - everywhere the same problem (((
I had to downgrade to "[email protected]" due to another android issue, but this LD_RUNPATH_SEARCH_PATHS is still there and I simply live with it. Maybe even earlier version can do the job? Did you try 8.x.x?
Switching to capacitor resolved the issue for me. I could not workout why downgrading cordova-ios did not work.
@toxaq Have you been able to use this plugin successfully with capacitor? Does your app use push notifications? I was under the impression that this plugin does not work with capacitor (at least for push notifications).
@jh-gh no, I just pulled the whole thing and use the capacitor push notifications plugin. That was all I was using functionality wise. I spent less time rewriting than I did trying every variation of versions to never succeed in getting this to compile.
@toxaq Thanks for the reply. I may have to do something similar at some point if I move to capacitor. However I would prefer to keep using this awesome plugin if possible as it has great features and incredible support ... just not for capacitor unfortunately at this point.
i am getting this build issue :
ionic: 5
cordova-ios: 6.0.0
cordova : 9.0.0
cordova-plugin-firebasex: 11.0.2,
Preparing Firebase on iOS
LD_RUNPATH_SEARCH_PATHS.substr is not a function
You folks don't like this answer but problem is cordova-ios 6.x.x as mentioned above.
I spent hours on this error with Cordova (9 & 10) FirebaseX (8.0.1 & 11.0.3) but couldn't find another solution. Including XCode build settings. First i suspected Cordova 10 but no it's just about cordova-ios version. 5.1.1 works well.
ionic cordova platform add [email protected]
Man, indeed downgrading to 5.1.1 saved me. Been on this issue for 2 days already, nothing worked except this.
@lifox89 I am in the need to use [email protected] as APP STORE is keep rejecting my app because existence of something called "UIWebView". This soliton is a suggested solution in this discussion
@Crypt0Graphic I am just doing like you right now!
I am doing math and trying to mix versions numbers with each other to get a successful build to the APPLE STORE!!
Here is what WORKED FOR ME.
You just open XCode and build the app from it. That's it !!
You can also Archive and Validate the app.
@lifox89 I am in the need to use [email protected] as APP STORE is keep rejecting my app because existence of something called "UIWebView". This soliton is a suggested solution in this discussion
5.1.1 uses the new WKWebView you just had to put in the config.xml explicitly.
This way when it builds, it will force to use the new wkwebview. I always make sure that I build prod from the ionic cli, so that I won't miss anything. Incomplete build from ionic cli might leave something that is needed, and the app might not work properly in produciton.
@lifox89
Here is sample of my config.xml

I don't know what's wrong!! I've uploaded 8 apps to store till now and they are all rejected!!
Trying cordova@5 or 6 with cordova 9 or 10 didn't help, although all of suspicions plugins have been updated to latest versions as suggested from the fellas.
@lifox89 I am in the need to use [email protected] as APP STORE is keep rejecting my app because existence of something called "UIWebView". This soliton is a suggested solution in this discussion
UIWebView is another issue:
The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.
I use that preference under ios section for cordova-ios 5.1.1. No problem with App Store:
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
More Info: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/
@lifox89 I am in the need to use [email protected] as APP STORE is keep rejecting my app because existence of something called "UIWebView". This soliton is a suggested solution in this discussion
UIWebView is another issue:
The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.
I use that preference under ios section for cordova-ios 5.1.1. No problem with App Store:
<platform name="ios"> <preference name="WKWebViewOnly" value="true" />More Info: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/
Hello @Crypt0Graphic
Maybe because your app is already on the store. Actually this is a first time app. Believe me I've tried many stuff. I ended up migrating to another framework :(
Hello @Crypt0Graphic
Maybe because your app is already on the store. Actually this is a first time app. Believe me I've tried many stuff. I ended up migrating to another framework :(
I uploaded a new app in April '20. I remember i got a similar error and solved as i said. Btw December '20 is last date for existing apps. We will see if it's a valid solution soon.
It's 2021! any tries with App Store yet. xD
It's 2021! any tries with App Store yet. xD
Anymore new or existing apps are in same situation and i published a new version of existing app in 2021 without problem. Solution seems ok.
Most helpful comment
Has this been released? I'm in dependency hell at the moment.