Android apps crash before restart

My Android app continues to crash before restarting automatically. When it works (after clicking the "Run" button) the log cat,

02-17 13:26:59.550: E/AndroidRuntime(1072): FATAL EXCEPTION: main
02-17 13:26:59.550: E/AndroidRuntime(1072): java.lang.RuntimeException: Unable to         instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for com.example.con4; is package not installed?
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4417)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.ActivityThread.access$1300(ActivityThread.java:141)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.os.Looper.loop(Looper.java:137)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.ActivityThread.main(ActivityThread.java:5103)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at java.lang.reflect.Method.invokeNative(Native Method)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at java.lang.reflect.Method.invoke(Method.java:525)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at dalvik.system.NativeStart.main(Native Method)
02-17 13:26:59.550: E/AndroidRuntime(1072): Caused by: java.lang.IllegalStateException: Unable to get package info for com.example.con4; is package not installed?
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:369)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
02-17 13:26:59.550: E/AndroidRuntime(1072):     at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
02-17 13:26:59.550: E/AndroidRuntime(1072):     ... 11 more

It will take about 5 seconds before he returns.

I tried exploring the logcat bits, but had a lot of mixed results.

Are there any tips to get it working without crashing at runtime.

+3
source share
1 answer

The problem was that I performed all the basic functions of the main GUI thread.

I did multithreading, now it works.

, AVD, , , .

+2

All Articles