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

Building App with SDK 29 Crash on Android 10 #2927

Closed
2 tasks
satyajiit opened this issue Nov 19, 2019 · 21 comments · Fixed by #2987
Closed
2 tasks

Building App with SDK 29 Crash on Android 10 #2927

satyajiit opened this issue Nov 19, 2019 · 21 comments · Fixed by #2987

Comments

@satyajiit
Copy link

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

  1. Use any android 10 device or emulator
  2. Install from playStore or run from debug
  3. 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
ezgif com-video-to-gif

GIF Showing Crash of latest version App from PlayStore

ezgif com-video-to-gif (1)

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.
@codedsun
Copy link
Contributor

@satyajiit The issue is specified clearly. Please look into the logs

@satyajiit
Copy link
Author

@codedsun I have gone through the logcat but couldn't find a correct clue to track the issue.
As far i have checked, I think the Android_Iconics 2.x.x library has some issues.
Can you please provide some clues or info?

@codedsun
Copy link
Contributor

@satyajiit Please look this
mikepenz/Android-Iconics#470

Also please get this done as early as possible

@satyajiit
Copy link
Author

@codedsun The Quick Fix can be to downgrade the compileSDK to 28 .
Trying to fix the issue with the Iconics is successful ,
But i seem to get more issues related to Context.
On SDK 29 , seems to have some behavior changes.

@codedsun
Copy link
Contributor

codedsun commented Nov 20, 2019 via email

@codedsun
Copy link
Contributor

@satyajiit Updates?

@satyajiit
Copy link
Author

@codedsun I am having my end terms/sem now 😟 .
I am not getting sufficient time.
And About the issue , even if i am able to fix the problem with Iconis , I am getting a new issue with the query selector , Something seems to return null , I will add the system logs for reference.

@codedsun
Copy link
Contributor

Please add

@satyajiit
Copy link
Author

satyajiit commented Nov 22, 2019

@codedsun
2019-11-22 21:25:11.908 16584-16638/org.fossasia.phimpme E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: org.fossasia.phimpme, PID: 16584 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$4.done(AsyncTask.java:399) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) at java.util.concurrent.FutureTask.setException(FutureTask.java:252) at java.util.concurrent.FutureTask.run(FutureTask.java:271) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: android.database.sqlite.SQLiteException: near "GROUP": syntax error (code 1 SQLITE_ERROR): , while compiling: SELECT parent, bucket_display_name FROM files WHERE ((owner_package_name IN ( 'org.fossasia.phimpme' ) OR media_type=2 OR media_type=4 OR media_type=0 AND mime_type LIKE 'audio/%' OR media_type=3 OR media_type=0 AND mime_type LIKE 'video/%' OR media_type=1 OR media_type=0 AND mime_type LIKE 'image/%') AND (is_pending=0) AND (is_trashed=0)) AND ((media_type=? ) GROUP BY ( parent )) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:184) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) at android.content.ContentProviderProxy.query(ContentProviderNative.java:437) at android.content.ContentResolver.query(ContentResolver.java:962) at android.content.ContentResolver.query(ContentResolver.java:890) at android.content.ContentResolver.query(ContentResolver.java:846) at org.fossasia.phimpme.gallery.data.providers.MediaStoreProvider.getAlbums(MediaStoreProvider.java:100) at org.fossasia.phimpme.gallery.data.providers.MediaStoreProvider.getAlbums(MediaStoreProvider.java:26) at org.fossasia.phimpme.gallery.data.HandlingAlbums.loadAlbums(HandlingAlbums.java:54) at org.fossasia.phimpme.gallery.activities.SplashScreen$PrefetchAlbumsData.doInBackground(SplashScreen.java:223) at org.fossasia.phimpme.gallery.activities.SplashScreen$PrefetchAlbumsData.doInBackground(SplashScreen.java:217) at android.os.AsyncTask$3.call(AsyncTask.java:378) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:919) 

Some non-SDK access warnings are also there ,

Accessing hidden field Ljava/io/FileDescriptor;->descriptor:I (greylist, JNI, allowed)

Ref : https://developer.android.com/about/versions/10/non-sdk-q

@codedsun
Copy link
Contributor

@iamareebjamal I need your help here, when I bumped the version of IconicsLibray to v3.2.5 (which is not the latest but we have used as its the latest for non-kotlin projects) But I am still getting the same crash on Android 10. Also, please look at this and guide us what is to be done ?

mikepenz/Android-Iconics#470

@iamareebjamal
Copy link
Member

iamareebjamal commented Dec 22, 2019

Why are you not uprading to the latest version?

as its the latest for non-kotlin projects

Every kotlin library can work with java, that's the point of kotlin

Why won't this work? mikepenz/Android-Iconics#470 (comment)

@codedsun
Copy link
Contributor

@iamareebjamal - We are not using IconicsContextWrapper, the crash is of InternalLayoutInflater

 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)

@iamareebjamal
Copy link
Member

And how does it matter? Either the issue you linked is not related to the crash, or the fixes mentioned in it will work. How does it matter that we are not using IconicsContextWrapper, issue has to be fixed anyway

@codedsun
Copy link
Contributor

Issue has to be fixed but you asked here why wont this work, it was the reply of that question.

@iamareebjamal
Copy link
Member

iamareebjamal commented Dec 22, 2019

Why not use the latest version instead of trying to fix a buggy and outdated version?

@codedsun
Copy link
Contributor

codedsun commented Dec 22, 2019

I did that but still facing some issues, will solve and send the PR

@iamareebjamal
Copy link
Member

@codedsun
Copy link
Contributor

@iamareebjamal I have upgrarded to the latest version but the app is still crashing on LFMainActivity

    Process: org.fossasia.phimpme, PID: 13176
    android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class androidx.appcompat.view.menu.ActionMenuItemView
    Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class androidx.appcompat.view.menu.ActionMenuItemView
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.appcompat.view.menu.MenuItemImpl.showsTextAsAction()' on a null object reference
        at androidx.appcompat.view.menu.ActionMenuItemView.updateTextButtonVisibility(ActionMenuItemView.java:190)
        at androidx.appcompat.view.menu.ActionMenuItemView.setIcon(ActionMenuItemView.java:233)
        at com.mikepenz.iconics.context.IconicsFactory.onViewCreatedInternal(IconicsFactory.kt:55)
        at com.mikepenz.iconics.context.IconicsFactory.onViewCreated(IconicsFactory.kt:39)
        at com.mikepenz.iconics.context.InternalLayoutInflater$PrivateWrapperFactory2.onCreateView(InternalLayoutInflater.kt:233)
        at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:186)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:811)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
        at com.mikepenz.iconics.context.InternalLayoutInflater.inflate(InternalLayoutInflater.kt:80)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at androidx.appcompat.view.menu.BaseMenuPresenter.createItemView(BaseMenuPresenter.java:167)
        at androidx.appcompat.view.menu.BaseMenuPresenter.getItemView(BaseMenuPresenter.java:186)
        at androidx.appcompat.widget.ActionMenuPresenter.getItemView(ActionMenuPresenter.java:193)
        at androidx.appcompat.widget.ActionMenuPresenter.flagActionItems(ActionMenuPresenter.java:473)
        at androidx.appcompat.view.menu.MenuBuilder.flagActionItems(MenuBuilder.java:1182)
        at androidx.appcompat.view.menu.BaseMenuPresenter.updateMenuView(BaseMenuPresenter.java:96)
        at androidx.appcompat.widget.ActionMenuPresenter.updateMenuView(ActionMenuPresenter.java:226)
        at androidx.appcompat.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:298)
        at androidx.appcompat.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:1069)
        at androidx.appcompat.view.menu.MenuBuilder.startDispatchingItemsChanged(MenuBuilder.java:1096)
        at androidx.appcompat.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:461)
        at androidx.appcompat.app.ToolbarActionBar$1.run(ToolbarActionBar.java:56)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:226)
        at android.app.ActivityThread.main(ActivityThread.java:7179)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)

@codedsun
Copy link
Contributor

@iamareebjamal - Also see the comment under release v4.0.0

https://github.com/mikepenz/Android-Iconics/releases

They say:

Dependencies

The following major dependency versions are required:

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.x.y"
implementation "androidx.core:core-ktx:$versions.ktx.core"
implementation "androidx.appcompat:appcompat:1.x.y"

@codedsun
Copy link
Contributor

codedsun commented Dec 22, 2019

@iamareebjamal - I have opened an issue on their issue tracker, I am getting error at inflating menu items in our app.

mikepenz/Android-Iconics#480

@jidanni
Copy link

jidanni commented Apr 10, 2020

Android says
"Phimp.me keeps stopping" or ..."has stopped"
Seen with Android 8.0 on ASUS ZenFone3
e.g., after moving the slider to 5% when attempting resize.
Fresh Google Play install.

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

Successfully merging a pull request may close this issue.

4 participants