1

First of all, I have Googled a lot for this error, and I couldn't find nothing that helps me to fix this problem... so, if this question is duplicated, forgive me.

I'm having some trouble with a strange error... I'm developing an app that targets a android minSdkVersion 14. I tested my app in the emulator, in a HTC, a Samsung Galaxy S2 and also a Nexus 4. The app have the exactly same behavior in all this devices, but it simple doesn't work in a Samsung GT-S6810.

I checked the Logcat for my app and there's no error, but if I check the entire log, I get this:

02-10 19:39:03.640: E/ActivityManager(1565): Activity Manager Crash
02-10 19:39:03.640: E/ActivityManager(1565): java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
02-10 19:39:03.640: E/ActivityManager(1565):    at java.util.ArrayList.get(ArrayList.java:306)
02-10 19:39:03.640: E/ActivityManager(1565):    at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:3518)
02-10 19:39:03.640: E/ActivityManager(1565):    at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:4213)
02-10 19:39:03.640: E/ActivityManager(1565):    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2696)
02-10 19:39:03.640: E/ActivityManager(1565):    at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:150)
02-10 19:39:03.640: E/ActivityManager(1565):    at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1754)
02-10 19:39:03.640: E/ActivityManager(1565):    at android.os.Binder.execTransact(Binder.java:367)
02-10 19:39:03.640: E/ActivityManager(1565):    at dalvik.system.NativeStart.run(Native Method)
02-10 19:39:03.660: E/JavaBinder(1565): *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
02-10 19:39:03.660: E/JavaBinder(1565): java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
02-10 19:39:03.660: E/JavaBinder(1565):     at java.util.ArrayList.get(ArrayList.java:306)
02-10 19:39:03.660: E/JavaBinder(1565):     at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:3518)
02-10 19:39:03.660: E/JavaBinder(1565):     at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:4213)
02-10 19:39:03.660: E/JavaBinder(1565):     at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2696)
02-10 19:39:03.660: E/JavaBinder(1565):     at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:150)
02-10 19:39:03.660: E/JavaBinder(1565):     at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1754)
02-10 19:39:03.660: E/JavaBinder(1565):     at android.os.Binder.execTransact(Binder.java:367)
02-10 19:39:03.660: E/JavaBinder(1565):     at dalvik.system.NativeStart.run(Native Method)

To be honest, I don't know if this error is directly connected with my app, but it shows up when I try to click in my menu, or in some other element that will start the activity.

Here is some code. This is just a little fragment but this works perfectly in the other devices and also in the emulator, as I said.

menuLogin.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {
        if (isAuthenticated()) {
            // some code...
        } else {
            Intent i = new Intent(BaseActivity.this,
                    AccountActivity.class);
            startActivity(i);
            overridePendingTransition(R.anim.slide_in_right,
                    R.anim.slide_out_left);
        }
    }
});

How can I fix this?

hichris123
  • 10,145
  • 15
  • 56
  • 70
j2sb
  • 23
  • 5
  • Don't actually know if that's the bottleneck causing your exception, but check this http://stackoverflow.com/questions/15604145/recommended-approach-for-handling-errors-across-process-using-aidl-android – nKn Feb 10 '14 at 22:08
  • Hi @NKN, tks for your answer. If I understood right, in that case, the guy has a remote process. In my project, I have everything in the same app, It's just an activity starting other activity. I also tried to debug the code above, and It "works" perfectly, the app don't crash and don't show me any errors. Any other idea? – j2sb Feb 10 '14 at 23:17

1 Answers1

1

Very strange behaviour here, but obviously you are getting an exception that seems to be thrown in one process(activity 1) but not handled there. This leads to java binder raising the uncaught remote exception, and making the activity manager crash upon start of activity 2. My suggestion to you is to debug and step it all through until you find the cause to the origin exception and handle it. The other thing you could try is to take a look at @NKN's link or this one Throw exceptions through several processes and see if you get any answers. Good luck and happy debuggin!

Community
  • 1
  • 1
Robert
  • 4,602
  • 4
  • 22
  • 33