I updated to SDK 23 and updated the gradle.build to API 23, support library to 23.0.0, etc and am now getting the following error when trying to run the app (compiles just fine).
java.lang.NoSuchFieldError: No instance field mFragments of type Landroid/support/v4/app/FragmentManagerImpl; in class Landroid/support/v4/app/Watson; or its superclasses (declaration of 'android.support.v4.app.Watson' appears in /data/app/com.my.app-1/base.apk)
at android.support.v4.app.Watson.onCreatePanelMenu(Watson.java:50)
at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(ActionBarSherlock.java:560)
at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchCreateOptionsMenu(ActionBarSherlockNative.java:64)
at com.actionbarsherlock.app.SherlockFragmentActivity.onCreatePanelMenu(SherlockFragmentActivity.java:164)
at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:548)
at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:917)
at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:258)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
I reverted back to API 22 on everything and still get the error.
I did the some thing as you did , but I found gradle can solve dependencies, in External Libraries i cannot find support-v4-23.0.0,support-v7-23.0.0 and other lib which the version is 23.0.0. then I reverted back to compile 'com.android.support:support-v4:22.2.0', the problem solver @mraviator
Thank you @zmarties for the answer , I want to add the details and links
Thank you for the above answers .
i had the same problem when import project eclipse to Android Studio
This is best solution for me
I found that I could build ActionBarSherlock using SDK 23 if I made the following two sets of changes:
in AnimatorProxy.java, replace FloatMath calls with their corresponding Math calls - i change FloatMath - to Math
in Waston Class i had the error - mFragments.isadded So, i replace the follow code instead of checking
mFragments.isadded != null
to
mFragments.getActiveFragments(mCreatedMenus)
everywher when it required
i had solve these issues.
Using google play services version 8.1.0 instead of 8.4.0 solved on my side
Did you change the theme view in the main layout from the design tab? Try changing it again to a Sherlock theme view at the design tab.
I found that I could build ActionBarSherlock using SDK 23 if I made the following two sets of changes:
FloatMath
calls with their correspondingMath
callsmFragments
field with a local variablefragments
initialized viagetActiveFragments(null)
, and then change themFragment
references to use the local variable