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

Error inflating class com.synnapps.carouselview.CarouselView #129

Open
PyaePhyoKyaw12 opened this issue Jun 9, 2022 · 3 comments
Open

Comments

@PyaePhyoKyaw12
Copy link

have implemented this library in my app, I tested it using Device Emulator and a real device (Galaxy S10), I noticed that it crashes when I open the activity containing the carouselview.

Crash report:

Process: com.ppk.clientapp, PID: 11062
android.view.InflateException: Binary XML file line #13 in com.ppk.clientapp:layout/fragment_home: Binary XML file line #13 in com.ppk.clientapp:layout/fragment_home: Error inflating class com.synnapps.carouselview.CarouselView
Caused by: android.view.InflateException: Binary XML file line #13 in com.ppk.clientapp:layout/fragment_home: Error inflating class com.synnapps.carouselview.CarouselView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:858)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
at com.ppk.clientapp.HomeFragment.onCreateView(HomeFragment.java:55)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
at android.app.Activity.performStart(Activity.java:8315)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4060)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
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)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewPager$OnPageChangeListener;
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
at android.view.LayoutInflater.createView(LayoutInflater.java:858) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:686) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:538) 
at com.ppk.clientapp.HomeFragment.onCreateView(HomeFragment.java:55) 
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963) 
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518) 
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282) 
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189) 
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100) 
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002) 
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138) 
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072) 
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251) 
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502) 
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246) 
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455) 
at android.app.Activity.performStart(Activity.java:8315) 
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4060) 
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) 
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) 
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438) 
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) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.ViewPager$OnPageChangeListener" on path: DexPathList[[zip file "/data/app/~~iBr7AuieUvdc_J1CvpCRvA==/com.ppk.clientapp-9OEUvPWykGMFVrW32NvLrw==/base.apk"],nativeLibraryDirectories=[/data/app/~~iBr7AuieUvdc_J1CvpCRvA==/com.ppk.clientapp-9OEUvPWykGMFVrW32NvLrw==/lib/arm64, /system/lib64, /system/system_ext/lib64]]
E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 38 more

@Aliabid321
Copy link

android.enableJetifier=true
inside the gradle.propertise file

@androdragon
Copy link

android.enableJetifier=true inside the gradle.propertise file

Great It works

@thiago-you
Copy link

Hi @androdragon @Aliabid321 , how you guys doing?

I ported this library with updated dependencies and configurations, also moved out from JCenter do use Jitpack.io:

https://github.com/thiago-you/carouselview

  • Move from JCenter to Jitpack.io
  • Migrate do Androidx libraries
  • Drop jetifier support
  • Update dependencies and libraries
  • Update configurations
  • Kotlin compatibility

Check it out!

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

No branches or pull requests

4 participants