2

I am new to android. I am using Googlemap activity on my App. minSdkVersio 15 and tagetSdkVersion 21. I am getting following exception for the device api below 16 and my code works perfectly fine for api 16 and above. How to get over with this? It says Nullpointerexception for actionbar search. I am using appcompat v7.

08-08 12:37:17.359: E/dalvikvm(32201): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.kf.a
08-08 12:37:17.379: E/dalvikvm(32201): Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.google.android.gms.common.kf.b
08-08 12:37:17.900: E/dalvikvm(32201): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.jy.a
Rishabh Agrawal
  • 1,998
  • 2
  • 25
  • 40
Varuni N R
  • 802
  • 3
  • 11
  • 31

2 Answers2

0

The classes displayed in the error are only available since API 16, and you should use the equivalent from the support libraries. e.g., android.app.Notification$BigTextStyle was introduced in api 16, you need to use android.support.v4.app.NotificationCompat.BigTextStyle, the equivalent class from the support library, if you want it to work on devices with api < 16.

If this is in your code, you must change the includes and probably some code. If it's in google map, then you should probably use SupportMapFragment instead of the regular one.

Sebastian
  • 1,076
  • 9
  • 24
-1

Please include latest version of android support library. Use SDK manager to download the latest version of Android Support Library and then follow the steps for Adding libraries with resources- https://developer.android.com/tools/support-library/setup.html and add the library to your application project.

Shadow Droid
  • 1,696
  • 1
  • 12
  • 26