InflationX / ViewPump

View Inflation you can intercept.
Apache License 2.0
897 stars 61 forks source link

ANR from ViewPump.init(ViewPump.builder() #53

Closed TobiasReich closed 1 year ago

TobiasReich commented 5 years ago

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

drakeet commented 4 years ago

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 commented 4 years ago

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 🌚

ZacSweers commented 4 years ago

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


From: Drakeet notifications@github.com 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.

drakeet commented 4 years ago

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

Rufim commented 4 years ago

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) 
ZacSweers commented 4 years ago

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

juancoob commented 4 years ago

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 😃

dirol90 commented 4 years ago

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

Dhatchanamoorthy commented 4 years ago

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

ZacSweers commented 1 year ago

Closing due to lack of information