xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

WatchOS app with Intent Exension: DYLD, dependent dylib '...libmonosgen-2.0.1.dylib' not found for TestFlight beta #7463

Open DamianMehers opened 4 years ago

DamianMehers commented 4 years ago

Steps to Reproduce

  1. Create a WatchOS app that has no external dependencies (with host iOS app)
  2. Add a WatchOS Intents Extension (which will force you to add a dummy one for the iOS app)
  3. Build it with Link Framework SDKs Onlyenabled . Verify that it runs locally on a real phone, in release build.
  4. Create an archive and upload to the store, submit to TestFlight and download the TestFlight app

Expected Behavior

No crash

Actual Behavior

Crash. I tried targettting WatchOS5.1 and 6.1 This is the diagnostic from the watch:

{"bug_type":"109","os_version":"Watch OS 6.1 (17S84)","build_version":"7","timestamp":"2019-11-17 15:48:33.43 +0100","is_beta":true,"app_name":"KranbanWatchOSExtension","bundleID":"com.atadore.Kannbann.watchkitapp.watchkitextension","incident_id":"B1FD5ADF-E222-4C5A-8460-55CA6ECFE08C","name":"KranbanWatchOSExtension","is_first_party":false,"app_version":"2019.1","share_with_app_devs":true,"slice_uuid":"794952c5-5c6c-3f00-a545-ec4aae744200","adam_id":1480933645}
Incident Identifier: B1FD5ADF-E222-4C5A-8460-55CA6ECFE08C
Beta Identifier:     E4C9B3EF-50A0-4555-A951-BD2B3E77C165
Hardware Model:      Watch5,4
Process:             KranbanWatchOSExtension [2163]
Path:                /private/var/containers/Bundle/Application/E4735812-3868-4208-ADCB-FDF98E652223/KranbanWatchOSApp.app/PlugIns/KranbanWatchOSExtension.appex/KranbanWatchOSExtension
Identifier:          com.atadore.Kannbann.watchkitapp.watchkitextension
Version:             7 (2019.1)
AppVariant:          1:Watch5,4:6
Beta:                YES
Code Type:           ARM (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.atadore.Kannbann.watchkitapp.watchkitextension [552]

Date/Time:           2019-11-17 15:48:33.2443 +0100
Launch Time:         2019-11-17 15:48:33.0000 +0100
OS Version:          Watch OS 6.1 (17S84)
Release Type:        User
Baseband Version:    2.01.04
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Description: DYLD, dependent dylib 
'/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/sdks/out/ios-targetwatch64_32-release/lib/libmonosgen-2.0.1.dylib' 
not found for '/private/var/containers/Bundle/Application/E4735812-3868-4208-ADCB-FDF98E652223/KranbanWatchOSApp.app/PlugIns/KranbanWatchOSExtension.appex/KranbanWatchOSExtension', 
tried but didn't find: 
'/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/sdks/out/ios-targetwatch64_32-release/lib/libmonosgen-2.0.1.dylib' 
'/usr/local/lib/libmonosgen-2.0.1.dylib' 
'/usr/lib/libmonosgen-2.0.1.dylib'
Highlighted by Thread:  0

Backtrace not available

Unknown thread crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x00000000007a2270   x3: 0x0000000000000147
    x4: 0x00000000007a1e70   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x27202762696c7964  x11: 0x62696c2f7273752f
   x12: 0x696c2f62696c2f72  x13: 0x6567736f6e6f6d62  x14: 0x2e312e302e322d6e  x15: 0x00202762696c7964
   x16: 0x0000000000000209  x17: 0x0000000000000000  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x00000000007a1e70  x21: 0x0000000000000147  x22: 0x00000000007a2270  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x0000000000ab8000  x26: 0x0000000000000000  x27: 0x0000000000000000
   x28: 0x00000000007a3b10   fp: 0x00000000007a1e40   lr: 0x0000000000aa30dc
    sp: 0x00000000007a1e00   pc: 0x0000000000a9c094 cpsr: 0x00000000
   esr: 0x00000000  Address size fault

Binary images description not available

Error Formulating Crash Report:
Failed to create CSSymbolicatorRef - corpse still valid ¯\_(ツ)_/¯

EOF

Environment

=== Visual Studio Community 2019 for Mac ===

Version 8.3.8 (build 8) Installation UUID: e2bf6735-5ded-4eb1-b901-9d8099d9d7bb GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)

Package version: 604000208

=== Mono Framework MDK ===

Runtime: Mono 6.4.0.208 (2019-06/07c23f2ca43) (64-bit) Package version: 604000208

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks SDK Versions: 3.0.100 2.1.701 2.1.700 2.1.505 2.1.504 2.1.503 2.1.302 2.1.301 2.1.4 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 3.0.0 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

=== Xamarin.Profiler ===

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

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.2.1 (15526.1) Build 11B500

=== Xamarin.Mac ===

Version: 6.6.0.12 (Visual Studio Community) Hash: e3c2b406d Branch: xcode11.2 Build date: 2019-11-01 00:12:07-0400

=== Xamarin.iOS ===

Version: 13.6.0.12 (Visual Studio Community) Hash: e3c2b406d Branch: xcode11.2 Build date: 2019-11-01 00:12:08-0400

=== Xamarin Designer ===

Version: 16.3.0.256 Hash: 8a223bfd7 Branch: remotes/origin/d16-3 Build date: 2019-11-01 21:02:02 UTC

=== Xamarin.Android ===

Version: 10.0.6.2 (Visual Studio Community) Commit: xamarin-android/d16-3/c407838 Android SDK: /Users/damian/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 7.0 (API level 24) 7.1 (API level 25) 8.0 (API level 26) 8.1 (API level 27)

SDK Tools Version: 26.1.1 SDK Platform Tools Version: 28.0.1 SDK Build Tools Version: 26.0.3

Build Information: Mono: mono/mono/2019-06@476d72b9e32 Java.Interop: xamarin/java.interop/d16-3@5836f58 LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94 LibZip: nih-at/libzip/rel-1-5-1@b95cf3fd ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.27.1@8212a2d Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333

=== Microsoft Mobile OpenJDK ===

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

=== Android SDK Manager ===

Version: 1.4.0.65 Hash: c33b107 Branch: remotes/origin/d16-3 Build date: 2019-11-06 18:31:30 UTC

=== Android Device Manager ===

Version: 1.2.0.116 Hash: d2b2af0 Branch: remotes/origin/d16-3 Build date: 2019-11-06 18:31:50 UTC

=== Xamarin Inspector ===

Version: 1.4.3 Hash: db27525 Branch: 1.4-release Build date: Mon, 09 Jul 2018 21:20:18 GMT Client compatibility: 1

=== Build Information ===

Release ID: 803080008 Git revision: 51ddc17b26f5a73f6e2a47feeb38bf1270662527 Build date: 2019-11-06 21:50:59+00 Build branch: release-8.3 Xamarin extensions: 010ea9b96369b2de32742f30576e92840acd1fac

=== Operating System ===

Mac OS X 10.15.1 Darwin 19.0.0 Darwin Kernel Version 19.0.0 Thu Oct 17 16:17:15 PDT 2019 root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64

rolfbjarne commented 4 years ago

It should be possible to work around this by disabling incremental builds in the watch extension's watchOS Build project options.

DamianMehers commented 4 years ago

@rolfbjarne this is for an app downloaded from TestFlight, built and archived in Release mode. I'll double-check but I'm pretty sure I don't have incremental builds enabled (is that even possible in release builds?)

DamianMehers commented 4 years ago

@rolfbjarne Double-checked. Incremental Builds not enabled. To confirm, it runs fine when I run it interactively in Release build from the IDE. Just not when downloaded in TestFlight.

I'm Archiving inside Visual Studio (Mac) and then signing and uploading to the App Store using Xcode Organizer.

I'm using the latest Release downloads of Xcode (11.2.1) and Visual Studio for Mac

DamianMehers commented 4 years ago

Removing the WatchKit Intents extension from the WatchOS app resolved this. I'll update the title. Still an issue because I'd like to handle a Siri intent in my watch app.

rolfbjarne commented 4 years ago

You can probably work around this by adding --nodevcodeshare to the additional mtouch arguments in both the watchOS extension and the watchOS Intents Extension's watchOS Build project options.

DamianMehers commented 4 years ago

@rolfbjarne That worked, many thanks for this workaround. For anyone wondering what that flag does, Rolf has a good explanation here