gpt4 book ai didi

android - NoSuchMethodError : No virtual method removeOnPageChangeListener 错误

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:41:55 25 4
gpt4 key购买 nike

我正在使用 ongakuer/CircleIndicator用于添加 viewpager 指标的库。除了更改一个小的 code 之外,我按原样使用了示例代码。从 customViewpager.addOnPageChangeListenercustomViewpager.setOnPageChangeListener 因为它显示编译错误。之后没有编译错误。

当我运行该 Activity 时,我立即收到以下错误:

java.lang.NoSuchMethodError: No virtual method removeOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V in class Landroid/support/v4/view/ViewPager; or its super classes (declaration of 'android.support.v4.view.ViewPager' appears in /data/app/com.app.app-2/base.apk)
at me.relex.circleindicator.CircleIndicator.setViewPager(CircleIndicator.java:127)
at com.app.app.ViewpagerActivity.onCreate(ViewpagerActivity.java:24)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

最佳答案

遇到与 RecyclerView.Adapter 类似的问题-

java.lang.NoSuchMethodError: No virtual method setAdapterCount ...

使缓存无效然后重新启动 Android Studio 解决了我的错误。 You can find directions to invalidate caches in IntelliJ (the software Android Studio is built upon) at this link .

关于android - NoSuchMethodError : No virtual method removeOnPageChangeListener 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30953820/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com