0

I'm getting the following back from Android PLay errors. The game was tested on the emulator, and my own real device (note 2) never got this error when making it.

What have I done wrong?

Exception class java.lang.NoSuchMethodError
Source method BaseActivity.onSetContentView()

and the stack

java.lang.NoSuchMethodError: com.google.ads.AdView.setRotation
at net.mindzone.trafficchaos.BaseActivity.onSetContentView(BaseActivity.java:81)
at org.andengine.ui.activity.BaseGameActivity.onCreate(BaseGameActivity.java:85)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)

EDIT For other people who want the answer, it was half of what jcw said. It is indeed a method which doesn't exists on a lower API. (in this case setRotation from the view, which is only available in api 13 and higher.) Though because I was calling it in the onSetContentView() it gave that as an error in google play.

Solution was: Putting the method inside a TRY ...CATCH... block and reverting back to oldskool transform of the view in case it failed. Now google play is not gibing me any user errors anymore.

renevdkooi
  • 1,515
  • 1
  • 17
  • 42

1 Answers1

0

I got this error recently too. It occurs when your app contains a method that is not availibe for all devices(because of api level). You will have to remove those methods and replace them with depreciated methods.

There is a better way to do this, but I could not get it to work, here is a link to the page, just modify the answer to fit your method - getSize() giving me errors

Alternatively, because I am not sure what your problem is, you could try downloading a new version of the ad mob SDK from their website.

Community
  • 1
  • 1
jcw
  • 5,132
  • 7
  • 45
  • 54
  • its not the admob sdk which is giving problems. It's onSetContentView which is the standard call for expanding the view. I have no idea why this is not available. Also, no idea what it was in the 2.2 android api – renevdkooi Nov 12 '12 at 03:08
  • Make sure that you have added the admob SDK .jar to your project. – jcw Nov 12 '12 at 06:30