Could not find class 'android.support.v4.view.ViewPager', referenced from method***

简介: Could not find class 'android.support.v4.view.ViewPager', referenced from method***

不知道为什么之前运行正常的程序,这几天居然报了以上的错误


而且我有引入ViewPager包,编译是不报错的,但运行时报ViewPager不存在。


解决办法:

1.既然提示工程中没有导入jar包,那么我们就手动将其导入:

右击工程选择 Bulid Path->Add Libraries->User Library->User Libraries->new(随便取一个名字,比如ViewPager )->Add Jars(将需要的jar包添加到ViewPager中) 如图所示:image.png


image.png


2.在properties中设置,右键工程->properties->Java Build Path->Order and Export 将刚刚新建的"ViewPager"勾选->点击ok 就可以了。如图所示:image.png


目录
相关文章
|
6月前
|
Android开发 开发者
Error:Could not find com.android.support:appcompat-v7:27.0.2.
Error:Could not find com.android.support:appcompat-v7:27.0.2.
130 0
|
3月前
|
Android开发 iOS开发
[ionic]解决运行Android、IOS出现Could not find the web assets directory
[ionic]解决运行Android、IOS出现Could not find the web assets directory
37 1
|
6月前
|
Android开发 开发者
安卓投屏神器 Scrcpy安 报错ERROR: Could not find any ADB device
安卓投屏神器 Scrcpy安 报错ERROR: Could not find any ADB device
360 9
|
6月前
|
Android开发 开发者
安卓投屏神器 Scrcpy安 报错ERROR: Could not find any ADB device
使用Scrcpy安卓投屏工具时遇到报错,问题根源是未开启开发者模式。解决步骤:进入设置,点击【关于手机】→连续点击版本号激活开发者模式,然后在【系统设置】→【开发者选项】中开启USB调试。参照此方法后可正常执行。Scrcpy软件下载链接和GitHub页面也已提供。
686 1
|
数据库 Android开发 数据库管理
java.lang.NullPointerException: Attempt to invoke virtual method ‘int android.database.sqlite异常
java.lang.NullPointerException: Attempt to invoke virtual method ‘int android.database.sqlite异常
359 0
NullPointerException:method 'android.content.BroadcastReceiver.onReceive' on a null object reference
NullPointerException:method 'android.content.BroadcastReceiver.onReceive' on a null object reference
Could not find com.android.support:appcompat-v7:25.3.1.
Could not find com.android.support:appcompat-v7:25.3.1.
82 0
|
开发工具 Android开发
Android Studio 报错Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT(解决方案)
Android Studio 报错Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT(解决方案)
Android Studio 报错Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT(解决方案)
|
Shell Android开发
理解adb错误:Can‘t find service: android.service.gatekeeper.IGateKeeperService
理解adb错误:Can‘t find service: android.service.gatekeeper.IGateKeeperService
理解adb错误:Can‘t find service: android.service.gatekeeper.IGateKeeperService
|
开发工具 Android开发
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
550 0
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path