程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> error-android 運行時出現的錯誤

error-android 運行時出現的錯誤

編輯:編程綜合問答
android 運行時出現的錯誤

我選擇logcat裡面的error,運行程序時出現以下錯誤,這是什麼呢?看不懂呀。運行多次後出現Unable to instantiate application android.app.Application: java.lang.NullPointerException。而我在另一個文件夾下載的項目做了一樣的修改,運行起來一點兒問題也麼,我搞不懂了。

每次出現的問題
05-16 09:40:07.532 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:07.532 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:12.557 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:12.557 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:16.922 425-581/? E/Watchdog﹕ !@Sync 70
05-16 09:40:17.562 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:17.572 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:22.597 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:22.597 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:27.612 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:27.622 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:32.607 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:32.607 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:37.622 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:37.622 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:42.627 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:42.627 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:43.658 425-435/? E/WifiP2pStateTracker﹕ getNetworkInfo : NetworkInfo: type: WIFI_P2P[], state: UNKNOWN/IDLE, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true
05-16 09:40:43.868 7171-7252/? E/MtpServerJNI﹕ server is null in send_object_added
05-16 09:40:43.868 7253-7253/? E/MTPJNIInterface﹕ In MTPJNIINterface onReceive:com.android.MTP.OBJECT_ADDED
05-16 09:40:43.908 639-639/? E/CscFactoryReceiver﹕ onReceive android.intent.action.MEDIA_SCANNER_FINISHED
05-16 09:40:43.918 639-639/? E/CscUpdateService﹕ costomer file is exists : it has been preconfiged.
05-16 09:40:43.928 639-639/? E/CscUpdateService﹕ costomer file is exists : it has been preconfiged.
05-16 09:40:43.938 639-8468/? E/CscParser﹕ update(): xml file exist
05-16 09:40:43.938 639-639/? E/CscUpdateService﹕ costomer file is exists : it has been preconfiged.
05-16 09:40:43.948 639-8479/? E/CscParser﹕ update(): xml file exist
05-16 09:40:43.958 639-8480/? E/CscParser﹕ update(): xml file exist
05-16 09:40:43.968 6928-6928/? E/EasyGalleryWidget﹕ itemCount : 106
05-16 09:40:43.968 6928-6928/? E/EasyGalleryWidget﹕ mItemCountForDBCheck : 0
05-16 09:40:43.978 6928-8483/? E/EasyGalleryWidget﹕ !!!!! UpdateRemoteViewThread run()
05-16 09:40:44.258 131-397/? E/MetadataRetrieverClient﹕ failed to extract an album art
05-16 09:40:44.258 6928-8483/? E/MediaMetadataRetrieverJNI﹕ getEmbeddedPicture: Call to getEmbeddedPicture failed.
05-16 09:40:46.921 425-581/? E/Watchdog﹕ !@Sync 71
05-16 09:40:47.662 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:47.662 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:52.686 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:52.686 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:40:57.711 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:40:57.711 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:41:02.716 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:41:02.716 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:41:07.751 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:41:07.751 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:41:12.756 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:41:12.756 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:41:16.930 425-581/? E/Watchdog﹕ !@Sync 72
05-16 09:41:17.791 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:41:17.791 7253-7253/? E/MtpService﹕ battPlugged Type : 2
05-16 09:41:22.806 7253-7253/? E/MtpService﹕ In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-16 09:41:22.806 7253-7253/? E/MtpService﹕ battPlugged Type : 2

運行多次後出現
05-16 09:47:18.683 8534-8534/com.xfengche.wwww.xfegncheradio_net E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4238)
at android.app.ActivityThread.access$1400(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4935)
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:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
at android.app.LoadedApk.makeApplication(LoadedApk.java:493)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4238)
            at android.app.ActivityThread.access$1400(ActivityThread.java:140)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4935)
            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:1038)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
            at dalvik.system.NativeStart.main(Native Method)

最佳回答:


AndroidManifest.xml中的application裡的android:name去掉試試

  <application
        android:name=""//去掉

或者自己繼承application重新寫一個

llx2007
llx2007
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved