ViewPump icon indicating copy to clipboard operation
ViewPump copied to clipboard

ANR from ViewPump.init(ViewPump.builder()

Open TobiasReich opened this issue 5 years ago • 9 comments

My app gets sometimes an ANR from that line ViewPump.init(ViewPump.builder()

looking like this:

"main" prio=5 tid=1 Runnable | group="main" sCount=0 dsCount=0 flags=0 obj=0x72b266f0 self=0x7c85cc3a00 | sysTid=25641 nice=0 cgrp=default sched=0/0 handle=0x7c8a49c9b0 | state=R schedstat=( 1753354711 262386751 2208 ) utm=30 stm=145 core=0 HZ=100 | stack=0x7ff109e000-0x7ff10a0000 stackSize=8MB | held mutexes= "mutator lock"(shared held)

Not sure it's actually the framworks fault but maybe anyone knows what this means

TobiasReich avatar Nov 01 '19 14:11 TobiasReich

I also encountered this problem, and the solution was to downgrade to version 1.0, that is, without Kotlin version, it was resolved. @jbarr21 @ZacSweers

drakeet avatar Dec 09 '19 09:12 drakeet

I'm pretty sure this is a problem with version 2.0, and it took me a long time to track this ANR, and it took me to finally find a solution through git commit rollback. Now finally someone has met, I believe it is not just on me!

image 🌚

drakeet avatar Dec 09 '19 09:12 drakeet

That's not really actionable for us. Can you provide a reproducing sample?


From: Drakeet [email protected] Sent: Monday, December 9, 2019 4:58 AM To: InflationX/ViewPump Cc: Zac Sweers; Mention Subject: Re: [InflationX/ViewPump] ANR from ViewPump.init(ViewPump.builder() (#53)

I'm pretty sure this was a problem with version 2.0, and it took me a long time to track this ANR, and it took me to finally find a solution through git commit rollback. Now finally someone has met, I believe it is not just on me!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/InflationX/ViewPump/issues/53?email_source=notifications&email_token=AAKMJPTIUWZTLCRKWFFROH3QXYJEXA5CNFSM4JH3DVH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGIQ6VY#issuecomment-563154775, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAKMJPQ4T3MEOOX73NV3PPDQXYJEXANCNFSM4JH3DVHQ.

ZacSweers avatar Dec 09 '19 16:12 ZacSweers

Sorry, it is hard, because It only happened on my user's device, I contacted him remotely to verify it, but I never found the root cause. Hope someone will help...

drakeet avatar Dec 09 '19 23:12 drakeet

I get same bug on one of my devices


  java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/os/BuildCompat;
        at io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater.<init>(-ViewPumpLayoutInflater.kt:25)
        at io.github.inflationx.viewpump.ViewPumpContextWrapper$inflater$2.invoke(ViewPumpContextWrapper.kt:25)
        at io.github.inflationx.viewpump.ViewPumpContextWrapper$inflater$2.invoke(ViewPumpContextWrapper.kt:22)
        at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
        at io.github.inflationx.viewpump.ViewPumpContextWrapper.getInflater(ViewPumpContextWrapper.kt)
        at io.github.inflationx.viewpump.ViewPumpContextWrapper.getSystemService(ViewPumpContextWrapper.kt:31)
        at android.view.LayoutInflater.from(LayoutInflater.java:232)
        at android.view.ContextThemeWrapper.getSystemService(ContextThemeWrapper.java:167)
        at android.app.Activity.getSystemService(Activity.java:5593)
        at android.view.LayoutInflater.from(LayoutInflater.java:232)
        at com.android.internal.policy.PhoneWindow.<init>(PhoneWindow.java:305)
        at com.android.internal.policy.PhoneWindow.<init>(PhoneWindow.java:316)
        at android.app.Activity.attach(Activity.java:6606)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2600)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2733)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1480)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6146)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.os.BuildCompat" on path: DexPathList[[zip file "/data/app/ru.samlib.client-1/base.apk"],nativeLibraryDirectories=[/data/app/ru.samlib.client-1/lib/arm, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater.<init>(-ViewPumpLayoutInflater.kt:25) 
        at io.github.inflationx.viewpump.ViewPumpContextWrapper$inflater$2.invoke(ViewPumpContextWrapper.kt:25) 
        at io.github.inflationx.viewpump.ViewPumpContextWrapper$inflater$2.invoke(ViewPumpContextWrapper.kt:22) 
        at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81) 
        at io.github.inflationx.viewpump.ViewPumpContextWrapper.getInflater(ViewPumpContextWrapper.kt) 
        at io.github.inflationx.viewpump.ViewPumpContextWrapper.getSystemService(ViewPumpContextWrapper.kt:31) 
        at android.view.LayoutInflater.from(LayoutInflater.java:232) 
        at android.view.ContextThemeWrapper.getSystemService(ContextThemeWrapper.java:167) 
        at android.app.Activity.getSystemService(Activity.java:5593) 
        at android.view.LayoutInflater.from(LayoutInflater.java:232) 
        at com.android.internal.policy.PhoneWindow.<init>(PhoneWindow.java:305) 
        at com.android.internal.policy.PhoneWindow.<init>(PhoneWindow.java:316) 
        at android.app.Activity.attach(Activity.java:6606) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2600) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2733) 
        at android.app.ActivityThread.-wrap12(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1480) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:154) 
        at android.app.ActivityThread.main(ActivityThread.java:6146) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 

Rufim avatar Jan 07 '20 10:01 Rufim

@rufim that looks unrelated and like a problem with your build missing classes in the final decision files.

ZacSweers avatar Jan 07 '20 15:01 ZacSweers

Hello, I would like to let you know in older projects without AndroidX, some devices (honor x9 and redmi note in my case) won't work using the last ViewPump library due to ANR problems. So I needed to downgrade to the version 1.0 to make them work. Thanks for your effort in that library 😃

juancoob avatar Jun 01 '20 15:06 juancoob

Same problem is I use version 1.0 work older devices like honor or Xiaomi, but in this case, I have a problem with all-new phones with android 10, and if I use 2.0.3 version I get crash on old devices

android.view.InflateException: Binary XML file line #17 in.com.engage./abc_screen_simple: Binary XML file line #17 in.com.engage./abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout

dirol90 avatar Aug 08 '20 20:08 dirol90

@dirol90 did u fix this issue? after updating library for android10 crash now im getting crash on lower device below 6.

Dhatchanamoorthy avatar Nov 06 '20 12:11 Dhatchanamoorthy

Closing due to lack of information

ZacSweers avatar Mar 25 '23 02:03 ZacSweers