googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 337 forks source link

[Bug] Application crash on launch - iOS 12.1.1 with EDM4U version 1.2.171 #575

Open Antonio-Iliev opened 1 year ago

Antonio-Iliev commented 1 year ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

The Unity application crashes on launch only on iPhones with iOS version 12.1, with EDM4U version 1.2.171 or above. Don't throw any errors. When the app is launched we see only the "activity" screen for less than a second and then it crashes. When we downgrade to EDM4U version 1.2.170 the application runs normally.

The issue repro rate is 100%.

You can reproduce this following this steps:

  1. Create a new Unity project with the 2D template.
  2. Add "com.google.external-dependency-manager-1.2.171.tgz" via Package Manager. Link to archive -https://developers.google.com/unity/archive#external_dependency_manager_for_unity
  3. Add "com.google.firebase.app-9.5.0.tgz" via Package Manager. Link to archive - https://developers.google.com/unity/archive#firebase_app_core
  4. From Build Settings switch to iOS.
  5. Check Symilink Unity libraries and Development Build.
  6. Build.
  7. In Xcode set Enable Bitcode to NO for both Unity-iPhone and UnityFreamwork.
  8. Run.

Thank you for your great work and "heads free" tool.

google-oss-bot commented 1 year ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

paulinon commented 1 year ago

Hi @Antonio-Iliev,

Thanks for reporting this. It's possible that the issue may be due to newer SDKs deprecating support for lower iOS versions. Let me bring this up to the team so we can confirm this.

Also, I see that you're importing a Firebase dependency. Could you try importing a .tgz file corresponding to a Firebase product and see if the behavior persists? Additionally, does the issue occur in any iOS version higher than 12.1 but lower than 13?

Antonio-Iliev commented 1 year ago

Hi @paulinon, Thanks for your quick response. Could you try importing a .tgz file corresponding to a Firebase product and see if the behavior persists? - I used the Package Manager to import a .tgz file for Firebase to reproduce the problem. The problem occurs for both Firebase versions 9.1.0 and 9.5.0 does the issue occur in any iOS version higher than 12.1 but lower than 13? - No, the problem only occurs on iOS 12.1 version. I tried on 12.3, and there aren't any problems.

a-maurice commented 1 year ago

So EDM4U 1.2.71 changed the Enable Swift Framework Support Workaround setting to be on by default, which was done because of the increased need for Swift support. With 1.2.71, if you try changing that in the Unity Editor, Assets > External Dependency Manager > iOS Resolver > Settings, does that affect the problem you are seeing?

Also, I know things change a lot with Xcode versions, what Xcode version are you using?

Antonio-Iliev commented 1 year ago

Hi @a-maurice, Thank you for the suggestion. Unfortunately, there is no difference with or without the Enable Swift Framework Support Workaround.

I'm using Xcode version 14.0.

@chkuang-g Thanks for fixing my title typo. :)

chkuang-g commented 1 year ago

@Antonio-Iliev

Could you send us two things: (and feel free to mask sensitive information!)

  1. Podfile generated by EDM4U. It should be under the ios build folder.
  2. Log and callstack when the app crashes. If you were running using Xcode, you should be able to see the the log from the output panel.

Thank you!

Shawn

Antonio-Iliev commented 1 year ago

Hi @chkuang-g

  1. Podfiles.zip
  2. This is the only log message before the crash:

2022-11-23 11:53:07.464716+0200 EDM4U-1.2.71[754:122969] Error loading /var/containers/Bundle/Application/3B68E5E1-2668-425C-AEF0-4A97E88419AF/EDM4U-1.2.71.app/Frameworks/UnityFramework.framework/UnityFramework: dlopen(/var/containers/Bundle/Application/3B68E5E1-2668-425C-AEF0-4A97E88419AF/EDM4U-1.2.71.app/Frameworks/UnityFramework.framework/UnityFramework, 265): Library not loaded: @rpath/libswiftCore.dylib Referenced from: /var/containers/Bundle/Application/3B68E5E1-2668-425C-AEF0-4A97E88419AF/EDM4U-1.2.71.app/Frameworks/UnityFramework.framework/UnityFramework Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/3B68E5E1-2668-425C-AEF0-4A97E88419AF/EDM4U-1.2.71.app/Frameworks/UnityFramework.framework/Frameworks/libswiftCore.dylib: code signature in (/private/var/containers/Bundle/Application/3B68E5E1-2668-425C-AEF0-4A97E88419AF/EDM4U-1.2.71.app/Frameworks/UnityFramework.framework/Frameworks/libswiftCore.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Thank you!

chkuang-g commented 1 year ago

Hmm, this looks like a typical problem when Swift core libraries was not included in the build. This is actually what that Enable Swift Framework Support Workaround setting was trying to resolve. However, this does not seem to work for you case. I wonder if this is something related to Xcode 14, since I implemented that workaround for Xcode 13.

Let me try to dig a bit.