apk をコンパイルすると、apk を「実行」すると次のようなエラーが表示されます。
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.robsie.quiz/com.robsie.quiz.SplashActivity}:
android.view.InflateException: Binary XML file line #7: Error inflating class
android.support.v4.view.ViewPager
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2309)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
at android.app.ActivityThread.access$600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5202)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #7: Error inflating
class android.support.v4.view.ViewPager
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
at android.app.Activity.setContentView(Activity.java:1885)
at com.robsie.quiz.SplashActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5108)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2263)
... 11 more
Caused by: java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.view.ViewPager" on path: /data/app/com.robsie.quiz-1.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.view.LayoutInflater.createView(LayoutInflater.java:552)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
... 21 more
しかし、Android Studioから開くと、最初に「プロジェクトを再構築」してから「実行」しても何も得られません..「実行」すると、このエラーが発生します..
java: can not find symbol
symbol: Variable layout
location: class com.robsie.quiz.R
私はCirclePageIndicatorを使用しています..そして、これは私の「build.gradle」です
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
compile files('libs/android-support-v4.jar')
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':C::Users:shekel:Desktop:WorkSpace:library')
}
android {
compileSdkVersion 11
buildToolsVersion "17.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}