cvzi / darkmodewallpaper

🌓 A live wallpaper for Android that respects dark theme mode 🌇
https://f-droid.org/packages/com.github.cvzi.darkmodewallpaper/
GNU General Public License v3.0
179 stars 11 forks source link

Crash on startup #50

Closed TBog closed 2 years ago

TBog commented 2 years ago

I'm getting this crash running the debug version on startup on my Samsung Galaxy S10+ Android 12

2022-05-04 09:50:07.227 14461-14461/com.github.cvzi.darkmodewallpaper.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.github.cvzi.darkmodewallpaper.debug, PID: 14461
    java.lang.RuntimeException: StrictMode ThreadPolicy violation
        at android.os.StrictMode$AndroidBlockGuardPolicy.onThreadPolicyViolation(StrictMode.java:1876)
        at android.os.StrictMode$AndroidBlockGuardPolicy.lambda$handleViolationWithTimingAttempt$0$StrictMode$AndroidBlockGuardPolicy(StrictMode.java:1790)
        at android.os.StrictMode$AndroidBlockGuardPolicy$$ExternalSyntheticLambda0.run(Unknown Source:6)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:226)
        at android.os.Looper.loop(Looper.java:313)
        at android.app.ActivityThread.main(ActivityThread.java:8663)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
     Caused by: android.os.strictmode.UnbufferedIoViolation
        at android.os.StrictMode$AndroidBlockGuardPolicy.onUnbufferedIO(StrictMode.java:1648)
        at libcore.io.IoTracker.trackIo(IoTracker.java:35)
        at java.io.FileInputStream.read(FileInputStream.java:320)
        at java.io.FileInputStream.read(FileInputStream.java:261)
        at com.android.org.kxml2.io.KXmlParser.setInput(KXmlParser.java:1750)
        at android.graphics.FontListParser.parse(FontListParser.java:116)
        at android.graphics.fonts.SystemFonts.getSystemFontConfigInternal(SystemFonts.java:269)
        at android.graphics.fonts.SystemFonts.getSystemPreinstalledFontConfig(SystemFonts.java:252)
        at android.graphics.Typeface.resetFontMap(Typeface.java:1836)
        at android.graphics.Typeface.setFlipFonts(Typeface.java:1939)
        at android.app.Application.onCreate(Application.java:260)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7506)
        at android.app.ActivityThread.access$1700(ActivityThread.java:310)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2281)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:226) 
        at android.os.Looper.loop(Looper.java:313) 
        at android.app.ActivityThread.main(ActivityThread.java:8663) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) 

I don't think it's something we can fix.

cvzi commented 2 years ago

It's this line that makes it crash in debug version, you can just remove that line for debugging. https://github.com/cvzi/darkmodewallpaper/blob/ece5ac7baffc60740e7a796ebe8822ea2433a28e/app/src/main/java/com/github/cvzi/darkmodewallpaper/App.kt#L36

I agree, it looks like something external causes it.