java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy

銳湃發表於2015-11-24

用Intent傳圖片爆出瞭如下錯誤:

13:42:04.785: E/JavaBinder(497): !!! FAILED BINDER TRANSACTION !!!
11-24 13:42:04.785: E/AndroidRuntime(18419): FATAL EXCEPTION: main
11-24 13:42:04.785: E/AndroidRuntime(18419): java.lang.RuntimeException: Unable to instantiate application com.hpw.framework.MovieBaseApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@53695198 (pid=18419) when registering receiver android.content.IIntentReceiver$Stub$Proxy@536864e0
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4392)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ActivityThread.access$1300(ActivityThread.java:141)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.os.Handler.dispatchMessage(Handler.java:99)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.os.Looper.loop(Looper.java:137)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ActivityThread.main(ActivityThread.java:5069)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at java.lang.reflect.Method.invokeNative(Native Method)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at java.lang.reflect.Method.invoke(Method.java:511)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at dalvik.system.NativeStart.main(Native Method)
11-24 13:42:04.785: E/AndroidRuntime(18419): Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@53695198 (pid=18419) when registering receiver android.content.IIntentReceiver$Stub$Proxy@536864e0
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.os.Parcel.readException(Parcel.java:1425)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.os.Parcel.readException(Parcel.java:1379)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ActivityManagerProxy.registerReceiver(ActivityManagerNative.java:2116)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1335)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1296)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1290)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.Instrumentation.newApplication(Instrumentation.java:968)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
11-24 13:42:04.785: E/AndroidRuntime(18419): 	... 11 more
11-24 13:42:04.789: W/ActivityManager(497): Exception in new application when starting activity com.hpw.framework/.MovieDetailsActivity
11-24 13:42:04.789: W/ActivityManager(497): android.os.TransactionTooLargeException
11-24 13:42:04.789: W/ActivityManager(497): 	at android.os.BinderProxy.transact(Native Method)
11-24 13:42:04.789: W/ActivityManager(497): 	at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:708)
11-24 13:42:04.789: W/ActivityManager(497): 	at com.android.server.am.ActivityStack.realStartActivityLocked(ActivityStack.java:697)
11-24 13:42:04.789: W/ActivityManager(497): 	at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:4270)
11-24 13:42:04.789: W/ActivityManager(497): 	at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:4334)
11-24 13:42:04.789: W/ActivityManager(497): 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:386)
11-24 13:42:04.789: W/ActivityManager(497): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1690)
11-24 13:42:04.789: W/ActivityManager(497): 	at android.os.Binder.execTransact(Binder.java:351)
11-24 13:42:04.789: W/ActivityManager(497): 	at dalvik.system.NativeStart.run(Native Method)
11-24 13:42:04.793: D/dalvikvm(18443): Late-enabling CheckJNI
11-24 13:42:04.793: E/Trace(18431): error opening trace file: No such file or directory (2)
11-24 13:42:04.793: I/ActivityManager(497): Start proc com.hpw.framework for activity com.hpw.framework/.MovieDetailsActivity: pid=18443 uid=10038 gids={50038, 3003, 1015, 1028}


後經多方查詢,終於在stackoverflow中找到答案:http://stackoverflow.com/questions/18096607/using-crop-intent-getting-java-lang-securityexception-unable-to-find-app-for-ca

原文如下: 
This log means that your app is having trouble handling a communication intent. Sometimes problems like this can be cause by sending an intent with big extras. Try to reduce the dimension of the image or, and this is the best way, save your image on the sd and put in the extras only the Uri of that image

翻譯:

意思是你在跳轉activity的過程中攜帶的extras中有圖片的Bitmap,應用盡量減少圖片的尺寸大小,應該通過儲存圖片到sd卡中或者通過uri方式傳遞圖片引數。

果然去掉了resultIntent.putExtra("bitmap", bitmap);這句後就不報錯了。


轉自:http://www.tuicool.com/articles/ABRVVj




相關文章