is 'dyld library not loaded- image not found' an error in the simulator or an error in the app extension? - ios-simulator

When I run a build with the simulator it crashes with this error, saying 'dyld: Library not loaded' and also 'image not found';
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/105F223C-3558-46E2-B3C0-CEF7E29B6B3D/data/Containers/Bundle/Application/D0F33E52-59FC-46EA-B1FF-DBE191CA4DD2/Watch.app/PlugIns/Watch Extension.appex/Watch Extension
Is this a simulator error, or an app code error? I would like to know if I can upload the app to the App store, or would it be an invalid build because of this error?
Also, any ideas on how I can fix it?

You cannot upload to the App Store this way, though I don't know why you would want to since you can't test your app.
Go to your main application and try turning on Always Embed Swift Standard Libraries (this was called Embedded Content Contains Swift in earlier releases).
Sometimes if the main app target doesn't have any Swift code or you have a plugin situation Xcode doesn't realize it should be including the Swift standard library in your bundle. In this case, for whatever reason, Xcode doesn't think Watch.app needs Swift so it doesn't include it even though your extension does use Swift.

Related

Xamarin Forms: BLE Laerdal Dfu OTA. compilation problems

I am trying to get an App to work with OTA Nordic Dfu, and the only xamarin nuget I can find was the one made by Laerdal on GitHub
When I try to build under iOS I am getting a few error like this one here:
Error MT5211: Native linking failed, undefined Objective-C class: _TtC13iOSDFULibrary11DFUFirmware. The symbol '_OBJC_CLASS_$__TtC13iOSDFULibrary11DFUFirmware' could not be found in any of the libraries or frameworks linked with your application.
A bug is open for this, but so far not a word from the people maintaining it.
I am left wondering if this is actually a local problem and not a problem with the nugget its self. So if any one out here is able to compile this under iOS help would be really appreciated.

Migrating Xamarin.Forms Android app to AndroidX support packages

I have a Xamarin.Forms Android project, am I'm trying migrate from the old Android support packages to AndroidX. The migrate seems to work, and I end up having to add a reference to the AndroidX media package during compile.
The issue is that when I try to actually run the app, I get the exception
System.InvalidCastException: 'Unable to convert instance of type 'Android.Widget.RelativeLayout' to type 'AndroidX.AppCompat.Widget.Toolbar'.'
from the Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnCreate. My MainActivity class subclasses FormsAppCompatActivity and MainActivity's OnCreate immediately calls the base OnCreate. Visual Studio says the exception is from external code, so it doesn't show me anything.
The OnStart and OnResume overrides in my MainActivity are called and finish fine (its only one line of code configuring the CrossCurrentActivity plugin being used.
I'm at a loss as to how to track down the problem. I suspect the issue is somewhere in one of the packages I'm using, my main suspect being the Xam.Plugin.Iconize since it hasn't been updated for a while, but we rely on it and I'm not really sure how to prove where the issue is.
I recently migrated to AndroidX and published the app. Users have been reporting a lot of crashes on start. I'm still figuring it out. Weird part is that, it works fine on some devices but crashes on some others.
I have noticed a few files in Android project still refer to the old 'Android Support' lib. Make sure you change them manually to AndroidX.
Check the Toolbar.xml and Tabbar.xml (Android proj>Resources>Layout). I had this in my app, which was still using android.support.v7......
I suggest to check in all the files and update manually where ever required.

Still getting ITMS-90809: Deprecated API Usage after using --optimize=force-rejected-types-removal

This has been killing me for the last couple of days. I have read everything I can find on this error and have done what xamarin says but it still doesn't work.
I can't get my builds to get through azure pipeline xamarin.ios build and deploy to apple.
When I build locally I get messages like
MTOUCH : warning MT1502: One or more reference(s) to type 'UIKit.UIWebView' already exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' before linking
with a companion message that says no references after linking
when I use --warn-on-type-ref=UIKit.UIWebView with the optimize arg.
When I build on azure in my pipeline, I only see the MT1502 but nothing saying anything after linking. The build gets submitted to Apple and fails because of the ITMS message.
I don't know what to do. I am using the latest macOS vm image, mono 6.8.0.123, xamarin.ios 13.16.0.13, xcode 11.4.1. The pipeline worked fine before April 30 deadline, now no matter what, I can't get the linker to strip UIWebView.
Let me know what other info would be helpful. I am completely stuck at this point.
Thanks.
I just got my build to pass Apple's inspection.
What ended up working for me was building locally and packaging the ipa file. On my mac I then changed the ipa extension to zip and unzipped it. I used terminal to go to the YOURAPPNAME.app "folder" and used grep -r UIWebView . to search for references. Don't forget the . so it searches the current directory. I missed that at first and got some message that grep was listening on stdin.
For me that resulted in a line like this:
Binary file ./Frameworks/PersonalizedAdConsent.framework/PersonalizedAdConsent matches
Now, the important thing to note is the linker never warned about this, so I was completely unaware of it. In my case it was part of Firebase/Admob. I was only one release behind and updating to the latest fixed my problem.
I still am using --optimize=force-rejected-types-removal --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503 as my mtouch args. But builds now get through.
I hope this helps point you guys in the right direction, I've spent the last 3 days just trying to get builds to upload reading every post I could find on the web on this problem.
Solved !! I had to update the way how nugets are included to the iOS project .csproj file. The problem was that linker despite the --optimize=force-rejected-types-removal flag was not removing the UIWebView component form Xamarin.Forms 4.6 probably because it did not see it.
My project was created over two years ago and I was still using the packages.config file. After the update the flag started to work and grep query returned 0 :). The best way is to compare the old .csproj file with freshly created iOS project .csproj file and see how VS is referencing nugets.

Ionic push: web client incorrectly installs

Following the guidelines here: http://docs.ionic.io/docs/push-from-scratch I am having trouble with step 2 - installing ionic add ionic-platform-web-client.
My index file within my app adds <script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js"></script> as it should, however the file doesn't exist at this location, even after running 'ionic lib update'.
(For ease of explanation in this section I am using the non minified version of the bundle: ionic.io.bundle.js (the results are the same with both full and minified versions of the files)).
Manually adding ionic.io.bundle.js from https://github.com/driftyco/ionic-platform-web-client/tree/master/dist will give me this error:
"Uncaught TypeError: Cannot call method 'get' of undefined
ionic.io.bundle.js (3429,0)"
from this code:
key: "get",
value: function get(name) {
return this._settings.get(name);
}
I found a 'hacky' way to get the dev pushes working by simply returning this instead of the full return this._settings.get(name) statement, although this only really suits the purpose of debugging and additionally does not allow removal of developer mode by settings 'ionic config set dev_push false' or manually setting "dev_push":false in .io-config.json.
I am unsure as to whether manually adding ionic.io.bundle.js is simply adding to my problems or whether this is the right approach to take and that the errors produced are the real problem?
I am running:
ionic 1.1.0
ionic CLI 1.7.7,
cordova 5.3.3,
bower 1.6.2,
npm 2.11.3,
visual studio 2015 community with cordova/ionic setup,
I've also updated my android platform - for which I am currently building to (deploying to nexus 7).
TheCannot call method 'get' of undefined in ionic.io.bundle.js happens because of missing settings in the bundle.
This could be fixed by running:
ionic config build
Although I still haven't been able to install the ionic web platform via 'ionic add ionic-platform-web-client' in the cli I have managed to get the ionic push notifications working.
Firstly I made sure in my app directory within the cli to use 'ionic lib update'. As the setup of my project was different (thanks to visual studio). You will likely already have these files using a custom setup, but I found it's good to have the directories in place.
Secondly I manually downloaded the web client https://github.com/driftyco/ionic-platform-web-client4 not just the ionic.io.bundle.min.js which seemed to fix my "Uncaught TypeError: Cannot call method 'get' of undefined" problem mentioned previously, after I moved the entirety of this in my lib directory. (Make sure the name of the downloaded folder matches: "ionic-platform-web-client" exactly, and doesn't contain any words like master).
Thirdly, as I couldn't add version 1.3.0 of the push plugin (which continually gave me the beloved 'uh oh' error) I used 1.2.3 instead. I installed this via: 'cordova plugin add https://github.com/phonegap/phonegap-plugin-push.git#1.2.31'. Although I have just noticed 1.4.0 is available which may also work?
This should hopefully fix any issues you have, even if it's not a perfect solution. As a side note: I know it is mentioned somewhere on one of the ionic pages that you need to have a traditional project setup and then move the relevant files but it would be nice to have some description of how to go about this - as you may not know what the relevant files are. For anyone who comes here scratching their heads, If you're using visual studio to create your ionic projects from scratch or any other custom setup, you will likely run into the same issues, as the relevant directories created using 'ionic start myApp' will likely have been omitted.

error: Failed to parse qmlimportscanner output

I have a created a fresh QML quick application using Qt 5.3.2 on Mac. When I build it has 2 link errors.
Failed to parse qmlimportscanner output.:-1: error:
[iphonesimulator-debug] Error 66
I have not even made any changes to default application, why do I get these errors and how can I fix it?
I know this question is pretty old, however, as I just encountered the same error and finally managed to solve it: Your Project Path must not contain spaces for qml quick projects on ios.
Please do not ask me how or why this is the case (as it clearly works for desktop or android deployment), but this was the issue for me. After moving the project to a different location (a folder that does not contain spaces) it would run qmake and deploy just fine.

Resources