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

Using C# built-in Timer Crashes Android AAB Export #55638

Closed
MrZak-dev opened this issue Dec 5, 2021 · 6 comments
Closed

Using C# built-in Timer Crashes Android AAB Export #55638

MrZak-dev opened this issue Dec 5, 2021 · 6 comments

Comments

@MrZak-dev
Copy link

Godot version

3.4.mono.stable , 3.4.1.mono.rc1

System information

Android

Issue description

Using C# built-in Timer Crashes Android AAB Export.

maybe releated to #48458 ,

Steps to reproduce

  • New Project
  • Use C# built-in Timer
public override void _Ready()
    {
        MyTimer = new Timer();
        MyTimer.Interval = 1000;
        MyTimer.Elapsed += (sender, args) => {
            GD.Print("Hello");
        };
        MyTimer.Start();
        
    }
  • Export game to AAB
  • Extract APKs from exported AAB using Bundletool
$~ java -jar bundletool-all-1.8.2.jar build-apks --bundle=./exported.aab --output=./output.apks
  • Install output.apks to a connected Android device
$~ java -jar bundletool-all-1.8.2.jar install-apks --apks .\output.apks

Crash log

--------- 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 

Minimal reproduction project

UnisgTimersAABCrash.zip

@Calinou
Copy link
Member

Calinou commented Dec 5, 2021

@MrZak-dev Does it crash if you export a release APK instead (and a debug APK/one-click deploy)?

@MrZak-dev
Copy link
Author

MrZak-dev commented Dec 5, 2021

@Calinou No it doesn't , it crashes only when you export AAB and install it directly from Google play or using Bundletool and exporting apks from The AAB

@oknpk
Copy link

oknpk commented Jan 16, 2022

Hi, is there any solution?
After uploading the app to google play, the app crashes after splash screen.
No problem as .APK, now I'm trying to remove the timers and datetime methods from the project.

@MrZak-dev
Copy link
Author

MrZak-dev commented Jan 17, 2022

the only solution i found for my particular project is to not use C# built-in timers and i have switched all of them to the regular Godot timer Node.

@oknpk
Copy link

oknpk commented Jan 17, 2022

After a little look, my problem was different. I am using LiteDB database and LINQ. These also crash. I'll open a new issue after doing some more research.

@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

5 participants