Cordova ios angularjs not finding template - ios

I have a problem when i try to use a cordova ios app i built in xcode. Its starts and then i get a error that angularjs failed to load template. The same app works fine on browser and android.
The steps i do to build it
cordova build ios in terminal.
Then i open the .xcworkspace file to open it in xcode. Then i build it to a connected iphone. I get a splashscreen and i see that my init promisechain runs but then it stops.
templateUrl: 'js/modules/header/html/header.html',
Filestructure is www -> js -> modules -> header -> html -> header.html
The error i get is :
020-05-13 15:59:05.496068+0200 [3439:2658415] ERROR: [$templateRequest:tpload] http://errors.angularjs.org/1.7.8/$templateRequest/tpload?p0=.%2Fjs%2Fmodules%2Fheader%2Fhtml%2Fheader.html&p1=-1&p2=
file:///var/containers/Bundle/Application//.app/www/js/node_modules/angular/angular.min.js:7
Anyone have an idea how to solve it ?

So the problem was CORS.
After installing the plugin https://github.com/oracle/cordova-plugin-wkwebview-file-xhr it works as intended. I think they will solve it in cordova-plugin-wkwebview but for now the xhr plugin is necessary.

As iOS requires web view to run the Cordova application.
I needed to install the following plugin. Mine issue was resolved after plugin installation and rebuilding the app.

Related

Cant take to build in iOS after zebrautility: ^0.0.38 added

I'm new to Xcode in a flutter, when I integrated zebrautility plugin in the flutter project, the android module worked fine, and print works.
When I try to run on iPhone, it always throws an error
Could not build the precompiled application for the device.
Error (Xcode): Library not found for -lZSDK_API
Error launching application on Kirubha's iPhone.
Found the issue in plugin.
Need to add '.a' extension as like ( s.vendored_libraries = 'libZSDK_API.a' )
in zebrautility.podspec

IONIC 5 - InAppBrowser is not installed or you are running on a browser -XCODE 13

I have an IONIC 5 / cordova project and I use InAppBrowser to open a link.
In the next code:
const browser = this.iab.create(url);
I get error "WARN: InAppBrowser is not installed or you are running on a browser. Falling back to window.open" on execution time in IOS device and IOS emulator.
I have tried all kinds of things that I have found on the internet:
First, I have done many test with #ionic-native/in-app-browser plugin, but I always get the same result:
Remove node_modules, www, platform/ios
Re-install(remove and install) in-app-browser libraries
Recompile in dev and prod mode.
Same error..
I have tried it again with the new plugin:
$ ionic cordova plugin add cordova-plugin-inappbrowser
$ npm install #awesome-cordova-plugins/in-app-browser
I change the code to get the new native plugin
$ ionic cordova platform add ios
BUILD DEVEL and PROD
$ ionic cordova build ios
$ ionic cordova build ios --prod
Same result.
I have verified that the cordova plugins are installed in the /Plugins folder of the XCode project.
I have a couple of things to comment on:
Now I use XCode 13, but In XCode 12 works fine. To upgrade the XCode I have upgrade MacOS from Catalina To Monterey.
The only difference between the two projects is that in XCode 13 "Legacy build system" is disabled since it's "deprecated".
I don't know if XCode doesn't import the libraries, I don't know if "Legacy Build System" is necessary. I know nothing... :-(
Can anybody help me?
Thanks.
I found the problem.
In my project I have an "Object.prototype" function that it produce a big problem to loop objects.
Referring InAppBrowser pluguin, in file inappbrowser.js:
callbacks = callbacks || {};
for (var callbackName in callbacks) {
iab.addEventListener(callbackName, callbacks[callbackName]);
}
Perhaps it could be improved with an Object.keys(callbacks), but I think that It was my problem.
Thanks.

React-Native app can build for debugging but not for archiving

I'm trying to archive my iOS app which works fine when I build for debugging via xcode but when I try to archive the app I get the following errors which I'm not sure what's causing it
I think the real reason for failure would be a little above in the listing, which cannot be seen here.
I had similar kind of issue when updated react native to version 0.54.2 the iOS archive stopped working.
My error message was something like:
A problem occurred while trying to fetch the minifier. Path: "metro-minify-uglify" Cannot find module 'uglify-es'
And the problem was that my react native project only had uglify-js in node-modules (I quess that the new react native needed the uglify-es). So I installed that with:
npm install uglify-es --save
And after that I did (not sure if these are needed) xCode->clean project, shutdown xCode, delete Library->Developer->Xcode->DerivedData, restart Xcode and archive started working again.

No osx files in cordova-plugin-statusbar/networkstatus/network-information

I cloned the copay project for my development (https://github.com/Bitcoin-com/Wallet). There are dependencies involving statusbar and networkstatus, none for which the .m & .h files have been provided for OSX platform, in the cordova-plugin-statusbar and cordova-plugin-networkstatus (or the new cordova-plugin-network-information).
There are provisions only for android, iOS, windows, browser & wp. No OSX. The new cordova-plugin-network-information also includes (Blackberry10, firefoxos, tizen & ubuntu). Still no osx.
How can I work around this to be able to deploy to the osx platform?
THE UNDERLYING PROBLEM - For better understanding
After building copay and running the following command: $ cordova emulate osx, it builds OK and launches the OSX simulator with a blank screen. The other platforms (iOS and android) build and run OK, displaying the copay wallet app.
When i open the osx/Copay.xcodeproj file in Xcode, I run the app and it produces the same blank simulator screen. The error in the log reads:
2017-10-12 01:46:25.149 Copay[18616:649515] ERROR: Plugin 'NetworkStatus' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-10-12 01:46:25.149 Copay[18616:649515] ERROR: Plugin 'StatusBar' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-10-12 01:46:30.027 Copay[18616:649515] deviceready has not fired after 5 seconds.
2017-10-12 01:46:30.027 Copay[18616:649515] Channel not fired: onCordovaConnectionReady
Apparently, the plugins not loading is preventing the cordova "onCordovaConnectionReady" event from firing. So, what is the way around this?
If i am wrong, please point me in the right direction.
See attached images.
Thanks

ionic archive ios plugins not found

I'm trying to archive my IOS app (ionic app) and test it on device with Xcode.
When I run my app directly on device, everything is fine. I tried both debug and release scheme.
When I archive my app then upload it to a device with Xcode or via Testflight, I got no error, but I think some plugins are missing because app is broken.
unfortunately I can't debug JavaScript on this archived app so i'm not sure of the error.
all plugins are well listed when i run cordova plugin list and all are in plugins/ios.json file.
Everything is fine on Android
Any idea ?
thanks
I update my cordova version and delete plugins/ios.json file.
Now it's work !

Resources