xamarin / XamarinComponents

Plugins for Xamarin
MIT License
1.99k stars 692 forks source link

Xamarin.iOS deployed on testflight app crashes on start when MaterialComponents framework installed #597

Open EveNaari opened 5 years ago

EveNaari commented 5 years ago

Everything works fine on release/debug profiles, but from testflight on iPhone 5 (iOS 10.3.3) app crashes. With iPhone X (iOS 12.3.1) everything works fine.

Visual studio Community 2017 15.9.13 Xamarin.iOS SDK 12.4.0.64

newky2k commented 5 years ago

@EveNaari does deploying to the iPhone 5 directly work? Have you tried VS 2019?

EveNaari commented 5 years ago

If you mean deploy after build - yes, it works. I also tried VS19 on PC (16.2.0 with Xamarin.iOS SDK 12.14.0.83) and VS 2019 for Mac (8.0.9, build 5) - absolutely same result. And of course, if I delete MaterialComponents nuget - my app from testflight starts as usual, without any crashes.

newky2k commented 5 years ago

@EveNaari do you have the error log from Testflight, if it produces one?

EveNaari commented 5 years ago

2019-06-25

@newky2k That's all what I got

cjorgens79 commented 5 years ago

I am experiencing the same issue (its taken a while to track down), i basically ended up creating a brand new XF project and added small parts of the main code base until i was able to find the source of the crash. I too am using an iPhone 5 and iPad 3 for testing, both of these are crashing using the Test Flight build, but work perfectly when deployed to the device directly (in debug or release configurations). Adding global::Xamarin.Forms.FormsMaterial.Init(); causes the app to crash when installed from Test Flight.

In context, AppDelegate.cs looks like this

public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); global::Xamarin.Forms.FormsMaterial.Init(); LoadApplication(new App()); return base.FinishedLaunching(app, options); }

I am using VS 2019 16.2.0. The build settings of the .iOS project are default, except that I had to set the supported architectures to ARMv7+ARMv7s+ARM64 to support the iPhone5 and iPad3. Updated xcode to the latest version too yesterday (10.3)

Connecting console to the iPad and running the app says very little Application 'UIKitApplication:com.company.testapp[0xee7f]' crashed. Application '(null)' exited for an unknown reason Formulating report for corpse[349] TestApp.iOS

I cannot confirm if the app works ok on a newer device, as i only currently have access to an iPhone 5 (iOS 10.3.3) and iPad 3 (iOS 9.3.5), but as mentioned the app does work perfectly when deployed directly to the device.

This issue is unfortunately holding up our app schedule. Android is working perfectly, we just cant get the app working via Test Flight.

cjorgens79 commented 5 years ago

Attached is a sample application which reproduces the problem. Just update the bundle id to something you can use with your iTunes Connect and push it up to Test Flight then install onto an iPhone 5 or iPad 3 and it will crash on start. You can stop it crashing simply by commenting out the global::Xamarin.Forms.FormsMaterial.Init(); line in appdelegate.cs and resubmitting.

XFMaterialsIOSBug.zip

cjorgens79 commented 5 years ago

I have been able to test with an iPhone 7 and it worked fine (ARM64 only build). So definately seems to be specific to the older hardware or possibly the older iOS versions that hardware runs.

LeoJHarris commented 5 years ago

I had been battling this issue and just discovered the issue was todo with the global::Xamarin.Forms.FormsMaterial.Init(); line in appdelegate.cs and since removing this line my app is working fine again on iOS 10 from the app store. I can confirm this does not affect iOS 11 (I cant comment on anything besides what I have mentioned)

@newky2k

The log I was getting from my tablet when I ran the app from test flight was:

    {"bug_type":"109","os_version":"iPhone OS 10.3.3 (14G60)","build_version":"20",
"timestamp":"2019-08-12 13:22:57.19 +1200","is_beta":true,"app_name":"SampleApp.iOS","app_cohort":"2|date=1565571600000&sf=143461&tid=04e4ca7358ea8d2fba25d0b81f5490f8dffc926b37292b959073ec2761cfd257&ttype=i",
"bundleID":"com.myapp.sampleapp","incident_id":"C2990110-841A-4BBC-916A-61190A0D1CA9","name":"SampleApp.iOS","is_first_party":false,"app_version":"4.0","share_with_app_devs":false,"slice_uuid":"692e9d46-abd9-3e3f-a0ce-dbe5932cdc9b","adam_id":1474065797}
    Incident Identifier: C2990110-841A-4BBC-916A-61190A0D1CA9
    Beta Identifier:     281613BC-F3E4-42D7-8F93-0EE24AAEDE16
    Hardware Model:      iPad3,4
    Process:             SampleApp.iOS [1056]
    Path:                /private/var/containers/Bundle/Application/E15C620A-6E99-46ED-A9D7-95BA048E2B26/SampleApp.iOS.app/SampleApp.iOS
    Identifier:          com.myapp.sampleapp
    Version:             20 (4.0)
    Beta:                YES
    Code Type:           ARM (Native)
    Role:                Foreground
    Parent Process:      launchd [1]
    Coalition:           com.myapp.sampleapp [459]

    Date/Time:           2019-08-12 13:22:57.0883 +1200
    Launch Time:         2019-08-12 13:22:57.0000 +1200
    OS Version:          iPhone OS 10.3.3 (14G60)
    Report Version:      104

    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY
    Termination Description: DYLD, Library not loaded: @rpath/MaterialComponents.framework/MaterialComponents | Referenced from: /var/containers/Bundle/Application/E15C620A-6E99-46ED-A9D7-95BA048E2B26/SampleApp.iOS.app/SampleApp.iOS | Reason: image not found
    Triggered by Thread:  0

    Filtered syslog:
    None found

    Thread 0 Crashed:
    0   dyld                            0x02a701dc 0x2a4e000 + 139740
    1   dyld                            0x02a6fe3e 0x2a4e000 + 138814
    2   dyld                            0x02a6fe78 0x2a4e000 + 138872
    3   dyld                            0x02a51ca4 0x2a4e000 + 15524
    4   dyld                            0x02a54588 0x2a4e000 + 25992
    5   dyld                            0x02a4f1d0 0x2a4e000 + 4560
    6   dyld                            0x02a4f040 0x2a4e000 + 4160

    Thread 0 crashed with ARM Thread State (32-bit):
        r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x02bb8208
        r4: 0x000000b5    r5: 0x02bb7e08      r6: 0x00000000      r7: 0x02bb7dd4
        r8: 0x00000000    r9: 0x000000b5     r10: 0x00000000     r11: 0x00000000
        ip: 0x00000209    sp: 0x02bb7d94      lr: 0x02a6fe3f      pc: 0x02a701dc
      cpsr: 0x40000010

    Binary Images:
    0x9e000 - 0x278dfff SampleApp.iOS armv7  <692e9d46abd93e3fa0cedbe5932cdc9b> /var/containers/Bundle/Application/E15C620A-6E99-46ED-A9D7-95BA048E2B26/SampleApp.iOS.app/SampleApp.iOS
    0x2a4e000 - 0x2a79fff dyld armv7s  <ae540e30134e34dfbdc1a1e57b551611> /usr/lib/dyld

    EOF
LeoJHarris commented 4 years ago

Any plans to get Material working on iOS anytime soon? Update would be appreciated...

newky2k commented 4 years ago

@EveNaari , @LeoJHarris, @cjorgens79 - We have pushed out a pre-release of MaterialComponents v92 to nuget. Can you check to see if the issue stills occurs and if there are any other issues.

NelsonSantos commented 4 years ago

Any news on this?!

I have same issue running on iPhone 5C device with iOS version 10.3.3. Unfortunately the same is from one of our testers and I don't have access to it to plug and try a debug.

chrome050 commented 4 years ago

i have tested version 92.0.0-rc2 in my application (iPhone 8 Plus iOS 13.3.1) and could not find any improvement. The application crashes on startup.

{"app_name":"<secure>","timestamp":"2020-02-27 11:18:12.77 +0100","app_version":"1","slice_uuid":"<secure>","adam_id":0,"build_version":"1.0","bundleID":"<secure>","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 13.3.1 (17D50)","incident_id":"<secure>","name":"<secure>"}
Incident Identifier: <secure>
CrashReporter Key:   <secure>
Hardware Model:      iPhone10,5
Process:             <secure> [2059]
Path:                /private/var/containers/Bundle/Application/<secure>
Identifier:          <secure>
Version:             1.0 (1)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           <secure> [940]

Date/Time:           2020-02-27 11:18:11.7729 +0100
Launch Time:         2020-02-27 11:18:11.4276 +0100
OS Version:          iPhone OS 13.3.1 (17D50)
Release Type:        User
Baseband Version:    3.03.03
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Description: DYLD, Library not loaded: @rpath/MaterialComponents.framework/MaterialComponents |
 Referenced from: /private/var/containers/Bundle/Application/<secure> |
 Reason: no suitable image found.  Did find:
 /private/var/containers/Bundle/Application/<secure>.app/Frameworks/MaterialComponents.framework/MaterialComponents: code signature invalid for '/private/var/containers/Bundle/Application/<secure>.app/Frameworks/MaterialComponents.framework/MaterialComponents' 
 /private/var/containers/Bundle/Application/<secure>.app/Frameworks/MaterialComponents.framework/MaterialComponents: stat() failed with errno=1
Triggered by Thread:  0
chrome050 commented 4 years ago

Is there any hotfix/workaround besides commenting out FormsMaterial.Init() in iOS?

thyagobudal commented 4 years ago

Same problem here! Following this tutorial (https://docs.microsoft.com/pt-br/xamarin/xamarin-forms/user-interface/visual/material-visual) Material works fine while debug on simulator IOS and Android, but when I try to debug on my Iphone 7 this erros appears:

dyld: Library not loaded: @rpath/MaterialComponents.framework/MaterialComponents Referenced from: /private/var/containers/Bundle/Application/---/App.iOS.app/App.iOS Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/---/AgnozMobileApp.iOS.app/Frameworks/MaterialComponents.framework/MaterialComponents: code signature invalid for '/private/var/containers/Bundle/Application/---/App.iOS.app/Frameworks/MaterialComponents.framework/MaterialComponents' /private/var/containers/Bundle/Application/---/App.iOS.app/Frameworks/MaterialComponents.framework/MaterialComponents: stat() failed with errno=1

LeoJHarris commented 4 years ago

Any update on this? Or does Material still not work on production apps yet?

rajeshaz09 commented 4 years ago

This is blocking us to move further.