[2014-11-14 03:57:23 - Traffic] Android Launch!
[2014-11-14 03:57:23 - Traffic] adb is running normally.
[2014-11-14 03:57:23 - Traffic] Performing com.fuad.traffic.MainActivity activity launch
[2014-11-14 03:57:26 - Traffic] Uploading Traffic.apk onto device 'YT910DUTNU'
[2014-11-14 03:57:26 - Traffic] Installing Traffic.apk...
[2014-11-14 03:57:33 - Traffic] Success!
[2014-11-14 03:57:33 - appcompat_v7] Could not find appcompat_v7.apk!
[2014-11-14 03:57:33 - Traffic] Starting activity com.fuad.traffic.MainActivity on device YT910DUTNU
这是我的问题,当我在手机中运行时,我又遇到了问题,就像我的问题一样
11-14 19:10:02.090: W/dalvikvm(28725): Unable to resolve superclass of Lcom/fuad/traffic/MainActivity; (83)
11-14 19:10:02.090: W/dalvikvm(28725): Link of class 'Lcom/fuad/traffic/MainActivity;' failed
11-14 19:10:02.090: W/dalvikvm(28725): threadid=1: thread exiting with uncaught exception (group=0x40b019f0)
11-14 19:10:02.100: E/AndroidRuntime(28725): FATAL EXCEPTION: main
11-14 19:10:02.100: E/AndroidRuntime(28725): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.fuad.traffic/com.fuad.traffic.MainActivity}: java.lang.ClassNotFoundException: com.fuad.traffic.MainActivity
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.os.Handler.dispatchMessage(Handler.java:99)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.os.Looper.loop(Looper.java:137)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.ActivityThread.main(ActivityThread.java:4424)
11-14 19:10:02.100: E/AndroidRuntime(28725): at java.lang.reflect.Method.invokeNative(Native Method)
11-14 19:10:02.100: E/AndroidRuntime(28725): at java.lang.reflect.Method.invoke(Method.java:511)
11-14 19:10:02.100: E/AndroidRuntime(28725): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
11-14 19:10:02.100: E/AndroidRuntime(28725): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
11-14 19:10:02.100: E/AndroidRuntime(28725): at dalvik.system.NativeStart.main(Native Method)
11-14 19:10:02.100: E/AndroidRuntime(28725): Caused by: java.lang.ClassNotFoundException: com.fuad.traffic.MainActivity
11-14 19:10:02.100: E/AndroidRuntime(28725): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
11-14 19:10:02.100: E/AndroidRuntime(28725): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
11-14 19:10:02.100: E/AndroidRuntime(28725): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
11-14 19:10:02.100: E/AndroidRuntime(28725): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
11-14 19:10:02.100: E/AndroidRuntime(28725): ... 11 more
stackoverflow.com中的thanx for master:D
答案 0 :(得分:0)
导入appcompat_v7后检查其属性android部分,并确保选中Is Library
!然后将appcompat_v7项目添加到项目中的项目>属性> android,然后清理并重建你的项目!
答案 1 :(得分:0)
尝试:
告诉我们您是否尝试过某些事情以及发生了什么
答案 2 :(得分:0)
对于@mohammad,我发现了问题,在属性> java build path>项目中,问题是有appcompat文件夹。它必须删除。当我删除它的工作。但是当我运行程序时,下一个问题是这样的
'11-14 19:24:44.379: W/dalvikvm(29518): VFY: unable to resolve virtual method 292: Landroid/app/Notification$Builder;.setPriority (I)Landroid/app/Notification$Builder;
11-14 19:24:44.379: W/dalvikvm(29518): threadid=1: thread exiting with uncaught exception (group=0x40b019f0)
11-14 19:24:44.389: E/AndroidRuntime(29518): FATAL EXCEPTION: main
11-14 19:24:44.389: E/AndroidRuntime(29518): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fuad.traffic/com.fuad.traffic.MainActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class fragment
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.os.Handler.dispatchMessage(Handler.java:99)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.os.Looper.loop(Looper.java:137)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.ActivityThread.main(ActivityThread.java:4424)
11-14 19:24:44.389: E/AndroidRuntime(29518): at java.lang.reflect.Method.invokeNative(Native Method)
11-14 19:24:44.389: E/AndroidRuntime(29518): at java.lang.reflect.Method.invoke(Method.java:511)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
11-14 19:24:44.389: E/AndroidRuntime(29518): at dalvik.system.NativeStart.main(Native Method)
11-14 19:24:44.389: E/AndroidRuntime(29518): Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class fragment
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:268)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.Activity.setContentView(Activity.java:1837)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.fuad.traffic.MainActivity.onCreate(MainActivity.java:15)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.Activity.performCreate(Activity.java:4470)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-14 19:24:44.389: E/AndroidRuntime(29518): ... 11 more
11-14 19:24:44.389: E/AndroidRuntime(29518): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 6111000 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.common.GooglePlayServicesUtil.E(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.maps.internal.u.S(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.maps.internal.u.R(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.maps.SupportMapFragment$b.my(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.dynamic.a.a(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2158)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
11-14 19:24:44.389: E/AndroidRuntime(29518): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
11-14 19:24:44.389: E/AndroidRuntime(29518): ... 21 more
'