After updating my android project from Mobile SDK 1.3 to 1.4.1, it stoped working.

I get the following error:
dalvikvm - JNI ERROR (app bug): attempt to use stale local reference 0x1
dalvikvm - VM aborting
libc - Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)

I had several problems since some files in the Android specific repo were not updated to the newer versions and at some point I had some files in the last version and some other in some previous version; hunted all the most recent version of every file and ended up with the described problem.

After that I tried creating a new project based on the ContactExplorer hybrid sample and before I got my code in, it too had the same problem.

Has anyone had to deal with this?

I tracked the error to com.salesforce.androidsdk.ui.SalesforceR where there is an import com.salesforce.androidsdk.R;, and to my opinion this must be related to the problem since I can't find this R class.

I'm testing in Galaxy Tab 10.1 with Android 4.0.4 (GT-P7100).

Any help will be welcome. Thanks.

1 Answer 1


There have been significant changes from 1.3 to 1.4. However, you should be able to run the ContactExplorer provided with 1.4 without any issues. Did you run the install.sh script after downloading 1.4?

As far as the JNI issue you mentioned, it can be due to 2 reasons.

1) You are not linking to the correct cordova jar (2.2.0) - https://groups.google.com/forum/?fromgroups=#!msg/phonegap/U5U5X07bEUI/TG4VppzazfQJ

2) It has been reported commonly for ICS devices - https://stackoverflow.com/questions/9978011/android-ics-jni-error-attempt-to-use-stale-local-reference-0x1

You should be able to run this on a lower Android version without any problems. A good starting point is to get one of the sample apps such as ContactExplorer in a running state and then copy-paste you code in it.

  • Thank you for your answer, Gaurav. I had ran install.sh at one time but did not notice any changes, so I really can't tell you what it changed. About the cordova version I checked it lots of times, I was actually using 2.2. I will look further into number 2), since I've already ran out of options. Commented Dec 27, 2012 at 17:49
  • Hello once again, I stop researching for the last couple of weeks. But yesterday I got back at it and still have no solution. Tried what Gaurav suggested and a few more things, and still nothing: Using Android 2.3 had the same effect as before; changed the jdk version from 1.7 to 1.6, same thing. I'm going to try harder to get ContactExplorer to work and see what I get from there. Commented Jan 8, 2013 at 10:08
  • Have you tried running this on the emulator? I can provide a working APK if that helps. Commented Jan 9, 2013 at 10:49
  • Sorry for taking so long to answer back. As it turns out the way I had created the previous project was kind of messy, I basically copied anything I needed right into a project apart from the rest of the SDK. Don't know why this worked the first time with version 1.3 , but it certainly did not with 1.4 . My advice to anyone who goes through the same problem is to do things right, follow README.md to create your projects and it will probably be ok. Commented Feb 7, 2013 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .