To fix the errors mentioned: - Import the app support libraries as projects from sdk/extras/android/support/v7
Now I have this error:
12-04 05:54:16.067: E/AndroidRuntime(1749): FATAL EXCEPTION: main
12-04 05:54:16.067: E/AndroidRuntime(1749): Process: com.tfg.webquest, PID: 1749
12-04 05:54:16.067: E/AndroidRuntime(1749): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.tfg.webquest/com.tfg.webquest.SplashScreenActivity}: java.lang.ClassNotFoundException: Didn't find class "com.tfg.webquest.SplashScreenActivity" on path: DexPathList[[zip file "/data/app/com.tfg.webquest-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.tfg.webquest-1, /system/lib]]
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.ActivityThread.access$800(ActivityThread.java:135)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.os.Handler.dispatchMessage(Handler.java:102)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.os.Looper.loop(Looper.java:136)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.ActivityThread.main(ActivityThread.java:5017)
12-04 05:54:16.067: E/AndroidRuntime(1749): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 05:54:16.067: E/AndroidRuntime(1749): at java.lang.reflect.Method.invoke(Method.java:515)
12-04 05:54:16.067: E/AndroidRuntime(1749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
12-04 05:54:16.067: E/AndroidRuntime(1749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
12-04 05:54:16.067: E/AndroidRuntime(1749): at dalvik.system.NativeStart.main(Native Method)
12-04 05:54:16.067: E/AndroidRuntime(1749): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tfg.webquest.SplashScreenActivity" on path: DexPathList[[zip file "/data/app/com.tfg.webquest-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.tfg.webquest-1, /system/lib]]
12-04 05:54:16.067: E/AndroidRuntime(1749): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-04 05:54:16.067: E/AndroidRuntime(1749): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
12-04 05:54:16.067: E/AndroidRuntime(1749): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
12-04 05:54:16.067: E/AndroidRuntime(1749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
12-04 05:54:16.067: E/AndroidRuntime(1749): ... 11 more
I have solve the java.lang.NoSuchFieldError that I had at the beginning.
Can be useful this information to solve the error:(thank you)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tfg.webquest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".SplashScreenActivity"
android:label="@string/title_activity_splash_screen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".HomeActivity"
android:label="@string/title_activity_home" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.tfg.webquest.MainActivity" />
</activity>
<activity
android:name=".RegisterActivity"
android:label="@string/title_activity_register" >
</activity>
<activity
android:name=".RegisterCourseActivity"
android:label="@string/title_activity_register_course" >
</activity>
<activity
android:name=".RegisterSubjectActivity"
android:label="@string/title_activity_register_subject" >
</activity>
<activity
android:name=".RegisterSubjectsActivity"
android:label="@string/title_activity_list_view_checkboxes" >
</activity>
<activity
android:name=".QuestIntroActivity"
android:label="@string/title_quest_intro_activity" >
</activity>
<activity
android:name=".QuestActivity"
android:label="@string/title_quest_activity" >
</activity>
<activity
android:name=".StatisticActivity"
android:label="@string/StatisticActivity" >
</activity>
<activity
android:name=".GameFinishedActivity"
android:label="@string/GameFinishedActivity" >
</activity>
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings" >
</activity>
</application>
</manifest>
I think we can sum up comments discussion in an answer as it's obvious now. You're not adding android support library v7 correctly to your project. You have to add it as an Android library (with resources) not only the jar to libs folder. Follow support v7 .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.