简体   繁体   中英

java.lang.NoClassDefFoundError on Android 2.3.3 - 2.3.7

I've developed simple android app that works OK on the last versions of Android. But Google play report that some users with Android 2.3.3 - 2.3.7 have the next problem:

java.lang.NoClassDefFoundError: com.toolbarderv.aliexpressnavigator.SettingsActivity$GeneralPreferenceFragment
at com.toolbarderv.aliexpressnavigator.MainActivity$JsObject.getFragmentName(MainActivity.java:184)
at com.toolbarderv.aliexpressnavigator.MainActivity$JsObject.showOptions(MainActivity.java:156)
at android.webkit.WebViewCore.nativeTouchUp(Native Method)
at android.webkit.WebViewCore.nativeTouchUp(Native Method)
at android.webkit.WebViewCore.access$3300(WebViewCore.java:56)
at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1202)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:655)
at java.lang.Thread.run(Thread.java:1019)

The problem appear when a user press Settings menu item and trying to open Settings screen. I use the next code to call Settings page:

        Intent i = new Intent(MainActivity.this, SettingsActivity.class);
        i.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, getFragmentName(fragment));
        startActivityForResult(i, RESULT_SETTINGS);

I don't use Proguard. As I told, this way works on all versions of Android but some old. Great thanks for any ideas.

Fragments are only available after Honeycomb, if I am not mistaken.

To use them in Gingerbread you will need Support library

Check please if you correctly added libraries to your project. Check "Export" checkboxes in front of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM