Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Application Bundles (aab) not exporting correctly for Mono projects #48458

Closed
andy-noisyduck opened this issue May 4, 2021 · 4 comments

Comments

@andy-noisyduck
Copy link
Contributor

Godot version:
3.3 (Mono)

OS/device including version:
Win 10 exporting to Android 11

Issue description:
After exporting a Mono app using the AAB support added in 3.3, the app will successfully export but will crash on the device.

System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null)
   at (wrapper managed-to-native) System.TimeZoneInfo+AndroidTimeZones.monodroid_get_system_property(string,intptr&)
   at System.TimeZoneInfo+AndroidTimeZones.GetDefaultTimeZoneName () [0x00029] in <a947100bfc9e4b689622af54e1e07934>:0
   at System.TimeZoneInfo+AndroidTimeZones.get_Local () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0
   at System.TimeZoneInfo.CreateLocal () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0
   at System.TimeZoneInfo.get_Local () [0x00009] in <a947100bfc9e4b689622af54e1e07934>:0
   at System.TimeZoneInfo.ConvertTimeToUtc (System.DateTime dateTime, System.TimeZoneInfoOptions flags) [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0
   at System.DateTime.ToUniversalTime () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0

The same project exported as an APK does not crash, and runs as expected.

I suspect whether or not you hit this exception depends on which bits of Mono you are using in your project. Some API calls seem to be linked correctly, and some do not.

I'm unsure if related to this earlier issue #33851 - but they share the same error message.

Steps to reproduce:

  1. Call a method that invokes something in monodroid - e.g. DateTime.ToUniversalTime()
  2. Export application as APK and run on device - it should work as expected.
  3. Export application as AAB and run on device (e.g. via bundletool, or via Play Store) - it will crash.

Minimal reproduction project:
Testing-AndroidAABLinking.zip

@MrZak-dev
Copy link

I can confirm that this issue still exists in Godot.3.3.4.mono

--------- beginning of crash
2021-12-01 13:13:00.942 7285-7398/? A/libc: FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xc17ed80c)
2021-12-01 13:13:00.946 7285-7398/? A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7398 (Thread Pool Wor), pid 7285 (icopo.SpaceFire)
2021-12-01 13:13:00.939 7285-7342/? E/mono: Unhandled Exception:
    System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null)
        at (wrapper managed-to-native) System.TimeZoneInfo+AndroidTimeZones.monodroid_get_system_property(string,intptr&)
      at System.TimeZoneInfo+AndroidTimeZones.GetDefaultTimeZoneName () [0x00029] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo+AndroidTimeZones.get_Local () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo.CreateLocal () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo.get_Local () [0x00009] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.DateTime.get_Now () [0x00008] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Timers.Timer.MyTimerCallback (System.Object state) [0x00019] in <ff8dc755b313498597c01f2c3444935b>:0 
      at System.Threading.Timer+Scheduler.TimerCB (System.Object o) [0x00007] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00008] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 

@MrZak-dev
Copy link

@andy-noisyduck did you find any way around this issue ?
i have tested it on Godot_3.4.mono and i got the same result , still crashing .

@MrZak-dev
Copy link

I have opened this issue #55638 , It seems that this issue is related to using System.Timers in general

@akien-mga
Copy link
Member

Fixed by #57420.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants