当出现这个问题时候一瞬间有种崩溃的冲动,怎么搞都不行 点击直接运行后报错提示我下边这串玩意(手机屏幕上给我带个new 而且显示不出app logo,这是要逆天)
04-07 14:07:52.541: E/WifiManager(12996): mWifiServiceMessenger == null
04-07 14:07:52.628: E/AndroidRuntime(12996): FATAL EXCEPTION: main
04-07 14:07:52.628: E/AndroidRuntime(12996): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.haotang.pet/com.haotang.pet.MainActivity}: java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10101 nor current process has android.permission.READ_PHONE_STATE.
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2438)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.ActivityThread.access$600(ActivityThread.java:162)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.os.Handler.dispatchMessage(Handler.java:108)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.os.Looper.loop(Looper.java:153)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.ActivityThread.main(ActivityThread.java:5902)
04-07 14:07:52.628: E/AndroidRuntime(12996): at java.lang.reflect.Method.invokeNative(Native Method)
04-07 14:07:52.628: E/AndroidRuntime(12996): at java.lang.reflect.Method.invoke(Method.java:511)
04-07 14:07:52.628: E/AndroidRuntime(12996): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
04-07 14:07:52.628: E/AndroidRuntime(12996): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-07 14:07:52.628: E/AndroidRuntime(12996): at dalvik.system.NativeStart.main(Native Method)
04-07 14:07:52.628: E/AndroidRuntime(12996): Caused by: java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10101 nor current process has android.permission.READ_PHONE_STATE.
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.os.Parcel.readException(Parcel.java:1425)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.os.Parcel.readException(Parcel.java:1379)
04-07 14:07:52.628: E/AndroidRuntime(12996): at com.android.internal.telephony.IPhoneSubInfo$Stub$Proxy.getDeviceId(IPhoneSubInfo.java:182)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:346)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.telephony.ZTEPrivacyTelephonyManager.getDeviceId(ZTEPrivacyTelephonyManager.java:86)
04-07 14:07:52.628: E/AndroidRuntime(12996): at com.haotang.pet.util.Global.getIMEI(Global.java:159)
04-07 14:07:52.628: E/AndroidRuntime(12996): at com.haotang.pet.MainActivity.getIndex(MainActivity.java:396)
04-07 14:07:52.628: E/AndroidRuntime(12996): at com.haotang.pet.MainActivity.onCreate(MainActivity.java:205)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.Activity.performCreate(Activity.java:5181)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
04-07 14:07:52.628: E/AndroidRuntime(12996): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2400)
04-07 14:07:52.628: E/AndroidRuntime(12996): ... 11 more
[2016-04-07 14:12:13 - Pet_put_svn] ------------------------------
[2016-04-07 14:12:13 - Pet_put_svn] Android Launch!
[2016-04-07 14:12:13 - Pet_put_svn] adb is running normally.
[2016-04-07 14:12:13 - Pet_put_svn] Performing com.haotang.pet.FlashActivity activity launch
[2016-04-07 14:12:14 - Pet_put_svn] Uploading Pet_put_svn.apk onto device 'V5S'
[2016-04-07 14:12:15 - Pet_put_svn] Installing Pet_put_svn.apk...
[2016-04-07 14:12:25 - Pet_put_svn] Success!
[2016-04-07 14:12:26 - Pet_put_svn] Starting activity com.haotang.pet.FlashActivity on device V5S
[2016-04-07 14:12:26 - Pet_put_svn] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2016-04-07 14:12:29 - Pet_put_svn] Starting activity com.haotang.pet.FlashActivity on device V5S
[2016-04-07 14:12:29 - Pet_put_svn] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2016-04-07 14:12:32 - Pet_put_svn] Starting activity com.haotang.pet.FlashActivity on device V5S
[2016-04-07 14:12:32 - Pet_put_svn] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2016-04-07 14:12:35 - Pet_put_svn] Starting activity com.haotang.pet.FlashActivity on device V5S
[2016-04-07 14:12:36 - Pet_put_svn] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2016-04-07 14:12:39 - Pet_put_svn] Starting activity com.haotang.pet.FlashActivity on device V5S
[2016-04-07 14:12:39 - Pet_put_svn] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.haotang.pet/.FlashActivity contextId=0, taskId=0 }
[2016-04-07 14:12:39 - Pet_put_svn] ActivityManager: Error type 3
[2016-04-07 14:12:39 - Pet_put_svn] ActivityManager: Error: Activity class {com.haotang.pet/com.haotang.pet.FlashActivity} does not exist.
那那那 就是上边这串鬼。。解决方案:project --> clean 选中你的项目 执行 完了就ok 可以正常运行了