Repository: fossasia/phimpme-android

Issue #2927: Building App with SDK 29 Crash on Android 10
Created: 2019-11-19T00:19:14Z
Describe the bug
Building the App with SDK Tools 29 and BuildTools 29.0.2 will not run on android 10 devices.
The official version of the app i.e "1.10.0" is also built with SDK 29 ,
Hence the app is crashing on all android 10 devices.
To Reproduce

Use any android 10 device or emulator
Install from playStore or run from debug
App Crash on SplashScreen

Expected behavior
Should Run on Android 10 devices.
Logs
2019-11-19 05:33:57.502 15158-15158/org.fossasia.phimpme E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.fossasia.phimpme, PID: 15158
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.fossasia.phimpme/org.fossasia.phimpme.gallery.activities.SplashScreen}: android.view.InflateException: Binary XML file line #17 in org.fossasia.phimpme:layout/abc_screen_simple: Binary XML file line #17 in org.fossasia.phimpme:layout/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3374)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3513)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2109)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
     Caused by: android.view.InflateException: Binary XML file line #17 in org.fossasia.phimpme:layout/abc_screen_simple: Binary XML file line #17 in org.fossasia.phimpme:layout/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout
     Caused by: android.view.InflateException: Binary XML file line #17 in org.fossasia.phimpme:layout/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
        at com.mikepenz.iconics.context.ReflectionUtils.getValue(ReflectionUtils.java:29)
        at com.mikepenz.iconics.context.InternalLayoutInflater.createCustomViewInternal(InternalLayoutInflater.java:155)
        at com.mikepenz.iconics.context.InternalLayoutInflater.access$000(InternalLayoutInflater.java:20)
        at com.mikepenz.iconics.context.InternalLayoutInflater$PrivateWrapperFactory2.onCreateView(InternalLayoutInflater.java:246)
        at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:239)
        at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1069)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:659)
        at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.java:81)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:773)
        at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:552)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
        at org.fossasia.phimpme.base.BaseActivity.onCreate(BaseActivity.java:53)
        at org.fossasia.phimpme.base.ThemedActivity.onCreate(ThemedActivity.java:40)
        at org.fossasia.phimpme.base.SharedMediaActivity.onCreate(SharedMediaActivity.java:12)
        at org.fossasia.phimpme.gallery.activities.SplashScreen.onCreate(SplashScreen.java:63)
        at android.app.Activity.performCreate(Activity.java:7815)
        at android.app.Activity.performCreate(Activity.java:7804)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1318)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3349)
2019-11-19 05:33:57.502 15158-15158/org.fossasia.phimpme E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3513)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2109)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

GIF Showing Crash of Debug Release using SDK 29

GIF Showing Crash of latest version App from PlayStore

Smartphone Info:










Device
OnePlus7


Android Version
Android 10 OxygenOS 10.0.2



Additional context
The App runs fine on android versions < 10.
It seems to occur because of some outdated dependency libraries.
Since on android sdk 29, androidx has components been made mandatory ,
It might be that one of the library most probably Android-Iconics is causing the issue ( As checked from the logs ).
Currently the fast work-ground can be to use SDK 28 to build the project.
Would you like to work on the issue?


 Yes
 No
Other:
For fast solution I can create a PR to downgrade the sdk to 28 ,
Need your suggestions and reviews.

Duplicate issue #2984: App Crashes
Created: 2020-01-17T23:52:47Z
The app keeps on crashing every time I open it. I have already tried uninstalling and downloading the app, as well as closing out and opening the app back in. But the app will crash every time you try to open it.

Closing comment (2020-01-18T06:43:14Z): Similar to #2927