Xamarin-macios: [iOS14] App crash on boot in Release but not in Debug

Created on 16 Sep 2020  路  7Comments  路  Source: xamarin/xamarin-macios

Steps to Reproduce

  1. Build app and archive and submit to app store
  2. Install through TestFlight and open it

Expected Behavior

No crash

Actual Behavior

Crash

Termination Description: DYLD, dyld: Using shared cache: C00C8F4B-48D4-3947-8E36-9B6EE846615A | dependent dylib '@rpath/Mono.framework/Mono' not found for '/private/var/containers/Bundle/Application/83AAC8EC-3CDA-4D8A-A901-FA478238FA6X/X.iOS.app/X.iOS', tried but didn't find: '/private/var/containers/Bundle/Application/83AAC8EC-3CDA-4D8A-A901-FA478238FA6X/X.iOS.app/Frameworks/Mono.framework/Mono' '@rpath/Mono.framework/Mono' '/System/Library/Frameworks/Mono.framework/Mono'

Environment

XCode 12 12A7208

=== Visual Studio Enterprise 2019 for Mac ===

Version 8.7.6 (build 19)
Installation UUID: 33ba9349-a2e6-4f41-b8f4-0ead5fc49e6e
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

    Package version: 612000093

=== Mono Framework MDK ===

Runtime:
    Mono 6.12.0.93 (2020-02/620cf538206) (64-bit)
    Package version: 612000093

=== Roslyn (Language Service) ===

3.7.0-6.20412.3+d3c3a44a4e7ad31cc75c59be0d3df4a19ff33878

=== NuGet ===

Version: 5.7.0.6702

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.402/Sdks
SDK Versions:
    3.1.402
    3.1.401
    3.1.302
    3.1.301
    3.1.300
    3.1.202
    3.1.200
    3.1.102
    3.1.101
    3.1.100
    3.0.101
    3.0.100
    2.1.810
    2.1.701
    2.1.700
    2.1.505
    2.1.504
    2.1.503
    2.1.302
    2.1.301
    2.1.4
    2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    3.1.8
    3.1.7
    3.1.6
    3.1.5
    3.1.4
    3.1.2
    3.1.1
    3.1.0
    3.0.1
    3.0.0
    2.1.22
    2.1.21
    2.1.20
    2.1.19
    2.1.18
    2.1.17
    2.1.16
    2.1.15
    2.1.14
    2.1.13
    2.1.12
    2.1.11
    2.1.9
    2.1.8
    2.1.7
    2.1.2
    2.1.1
    2.0.5
    2.0.0

=== Xamarin.Profiler ===

Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.0 (17218)
Build 12A7208

=== Xamarin Designer ===

Version: 16.7.0.495
Hash: 03d50a221
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-08-28 13:12:52 UTC

=== Xamarin.Mac ===

Version: 6.99.0.251 (Visual Studio Enterprise)
Hash: 31659d61a
Branch: xcode12
Build date: 2020-09-08 15:46:03-0400

=== Xamarin.iOS ===

Version: 13.99.0.251 (Visual Studio Enterprise)
Hash: 31659d61a
Branch: xcode12
Build date: 2020-09-08 15:46:03-0400

=== Xamarin.Android ===

Version: 11.0.2.0 (Visual Studio Enterprise)
Commit: xamarin-android/d16-7/025fde9
Android SDK: /Users/admin/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        6.0 (API level 23)
        7.1 (API level 25)
        8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.3

Build Information: 
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/admin/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.7.0.13
Hash: 8380518
Branch: remotes/origin/d16-7~2
Build date: 2020-08-19 22:18:28 UTC

=== Android Device Manager ===

Version: 16.7.0.24
Hash: bb090a3
Branch: remotes/origin/d16-7
Build date: 2020-08-19 22:18:52 UTC

=== Build Information ===

Release ID: 807060019
Git revision: 87cb526764ccce0403f33091049e73e65a4fb453
Build date: 2020-09-10 07:43:49-04
Build branch: release-8.7-xcode12
Xamarin extensions: 87cb526764ccce0403f33091049e73e65a4fb453

=== Operating System ===

Mac OS X 10.15.6
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Thu Jun 18 20:49:00 PDT 2020
    root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64


Build Logs

Example Project (If Possible)

bug iOS

Most helpful comment

Same problem... exactly the same symptoms, all is fine in debug/dev... but broken in release, just when we need to delivery a customer :-(
I had to install again Xcode 11.7 on the mac (side-by-side with xcode12), download and install another previous instance of VisualStudio (16.7.3 to be xcode11.7 compatible), revert Xamarin.iOS (14 to 13.20) on the mac, etc... it takes me hours !
It's not the first time that "automatic updates" broke everything on our deliveries... and it makes years that we ask a "simple" process to revert to previous version/uninstall last updates".
Thanks for keeping us informed of this problem.

All 7 comments

Thank you for your feedback!

For us to investigate this further, could you please provide your full build logs and a test case (so that we can reproduce the problem).

To get full build logs just set the log verbosity to diagnostic at the following locations:

  • On Visual Studio for Mac: Preferences > Projects > Build
  • On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio for Windows you also want to add -v -v -v -v to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting Properties.

Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

We look forward to hearing from you!

In any case it's possible that adding --mono:static as an additional mtouch argument in your project's iOS Build options page could work around the issue.

Thanks a lot @rolfbjarne for your quick response. --mono:static worked. Here is the build logs https://1drv.ms/t/s!Ap1zDOSzYJGY5RoD6j7UBgLn0_oj?e=1hnmKG

I switched to stable branch but use the Xamarin.iOS pkg for iOS 14

````
=== Visual Studio Enterprise 2019 for Mac ===

Version 8.7.7 (build 10)
Installation UUID: 33ba9349-a2e6-4f41-b8f4-0ead5fc49e6e
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000093

=== Mono Framework MDK ===

Runtime:
Mono 6.12.0.93 (2020-02/620cf538206) (64-bit)
Package version: 612000093

=== Roslyn (Language Service) ===

3.7.0-6.20427.1+18ede13943b0bfae1b44ef078b2f3923159bcd32

=== NuGet ===

Version: 5.7.0.6702

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.402/Sdks
SDK Versions:
3.1.402
3.1.401
3.1.302
3.1.301
3.1.300
3.1.202
3.1.200
3.1.102
3.1.101
3.1.100
3.0.101
3.0.100
2.1.810
2.1.701
2.1.700
2.1.505
2.1.504
2.1.503
2.1.302
2.1.301
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.8
3.1.7
3.1.6
3.1.5
3.1.4
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
2.1.22
2.1.21
2.1.20
2.1.19
2.1.18
2.1.17
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.9
2.1.8
2.1.7
2.1.2
2.1.1
2.0.5
2.0.0

=== Xamarin.Profiler ===

Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.0 (17219)
Build 12A7209

=== Xamarin Designer ===

Version: 16.7.0.495
Hash: 03d50a221
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-08-28 13:12:52 UTC

=== Xamarin.Mac ===

Version: 6.20.2.2 (Visual Studio Enterprise)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:44:59-0400

=== Xamarin.iOS ===

Version: 14.0.0.0 (Visual Studio Enterprise)
Hash: 7ec3751a1
Branch: xcode12
Build date: 2020-09-16 11:33:15-0400

=== Xamarin.Android ===

Version: 11.0.2.0 (Visual Studio Enterprise)
Commit: xamarin-android/d16-7/025fde9
Android SDK: /Users/admin/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
7.1 (API level 25)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.3

Build Information:
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/admin/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.7.0.13
Hash: 8380518
Branch: remotes/origin/d16-7~2
Build date: 2020-08-19 22:18:28 UTC

=== Android Device Manager ===

Version: 16.7.0.24
Hash: bb090a3
Branch: remotes/origin/d16-7
Build date: 2020-08-19 22:18:52 UTC

=== Build Information ===

Release ID: 807070010
Git revision: e58142243407a357198d18ee1a37b1e67a702eff
Build date: 2020-09-10 11:48:02-04
Build branch: release-8.7
Xamarin extensions: e58142243407a357198d18ee1a37b1e67a702eff

=== Operating System ===

Mac OS X 10.15.6
Darwin 19.6.0 Darwin Kernel Version 19.6.0
Thu Jun 18 20:49:00 PDT 2020
root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64

````

Here is the build logs

I'm sorry, I was unclear, but could you attach a build log _without_ the --mono:static argument? I'd like to figure out why the problem you were having and fix it if I can.

Same problem... exactly the same symptoms, all is fine in debug/dev... but broken in release, just when we need to delivery a customer :-(
I had to install again Xcode 11.7 on the mac (side-by-side with xcode12), download and install another previous instance of VisualStudio (16.7.3 to be xcode11.7 compatible), revert Xamarin.iOS (14 to 13.20) on the mac, etc... it takes me hours !
It's not the first time that "automatic updates" broke everything on our deliveries... and it makes years that we ask a "simple" process to revert to previous version/uninstall last updates".
Thanks for keeping us informed of this problem.

I've faced similar issue - after any code changes if I try to start debug I'm getting app crash with the following error. After full solution rebuild debug has starting.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Description: DYLD, dyld: 
Using shared cache: 45689165-E005-3DF1-BAD9-7C597109D0F3 | dependent dylib '@rpath/realm-wrappers.framework/realm-wrappers' not found for '/private/var/containers/Bundle/Application/6F47AEFE-29B8-47A4-AA61-B52EE7493535/Flip2Learn.Forms.iOS.app/Flip2Learn.Forms.iOS', 
tried but didn't find: 
'/private/var/containers/Bundle/Application/6F47AEFE-29B8-47A4-AA61-B52EE7493535/Flip2Learn.Forms.iOS.app/Frameworks/realm-wrappers.framework/realm-wrappers' 
'@rpath/realm-wrappers.framework/realm-wrappers'
 '/System/Library/Frameworks/realm-wrappers.framework/realm-wrappers'

Please check if this applies to you:
https://www.reddit.com/r/xamarindevelopers/comments/iys4tw/do_not_use_xamarinformsvisualmaterial_for_ios_apps/

Citate: _The bad thing is, that this only happens using Testflight or App Store distribution. If you send the app to the device manually (eg debug from Visual Studio) or using AdHoc mechanisms, it works like a charm. Unfortunately, because of this, you may realize the issue only in the last phase while trying to distribute it._

Was this page helpful?
0 / 5 - 0 ratings