我创建了一个新的空android应用程序,只包含一个textView。
当我编译它时,我很遗憾app已停止
我在其他主题中寻找溶剂但没有效果。
这是我的logcat:
04-23 13:07:21.263: W/dalvikvm(1373): VFY: unable to resolve static field 1559 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
04-23 13:07:21.263: D/dalvikvm(1373): VFY: replacing opcode 0x62 at 0x0004
04-23 13:07:21.273: D/AndroidRuntime(1373): Shutting down VM
04-23 13:07:21.273: W/dalvikvm(1373): threadid=1: thread exiting with uncaught exception (group=0xb2abeba8)
04-23 13:07:21.293: E/AndroidRuntime(1373): FATAL EXCEPTION: main
04-23 13:07:21.293: E/AndroidRuntime(1373): Process: com.testandro, PID: 1373
04-23 13:07:21.293: E/AndroidRuntime(1373): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
04-23 13:07:21.293: E/AndroidRuntime(1373): at com.testandro.MainActivity.onCreate(MainActivity.java:18)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.Activity.performCreate(Activity.java:5231)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.os.Handler.dispatchMessage(Handler.java:102)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.os.Looper.loop(Looper.java:136)
04-23 13:07:21.293: E/AndroidRuntime(1373): at android.app.ActivityThread.main(ActivityThread.java:5017)
04-23 13:07:21.293: E/AndroidRuntime(1373): at java.lang.reflect.Method.invokeNative(Native Method)
04-23 13:07:21.293: E/AndroidRuntime(1373): at java.lang.reflect.Method.invoke(Method.java:515)
04-23 13:07:21.293: E/AndroidRuntime(1373): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-23 13:07:21.293: E/AndroidRuntime(1373): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-23 13:07:21.293: E/AndroidRuntime(1373): at dalvik.system.NativeStart.main(Native Method)
04-23 13:08:20.813: I/Process(1373): Sending signal. PID: 1373 SIG: 9
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testandro"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.testandro.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
答案 0 :(得分:0)
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
您尚未正确引用AppCompat。在引用之前,您需要拥有更新的支持库。您可以在额外内容下从sdk manager下载相同内容。
检查使用资源添加库 @
https://developer.android.com/tools/support-library/setup.html