Clever Tap Permissions

480 Views Asked by At

I am integrating claverTap in my app, I followed the integration document, but when I run my app this following error comes :-

com.clevertap.android.sdk.exceptions.CleverTapPermissionsNotSatisfied: Permission required: android.permission.INTERNET

issue, even I have added internet permission in AndroidManifest.xml file also,

Application Class Code Is

public class MyApplication extends Application {
public static CleverTapAPI cleverTap;
@Override
public void onCreate() {
    Log.e("application","class0");

        CleverTapAPI.setDebugLevel(1);
        CleverTapAPI.changeCredentials("","");
        ActivityLifecycleCallback.register(this); // Must be called before super.onCreate() of Application Class
        Log.e("application","class1");

        try {
            cleverTap = CleverTapAPI.getInstance(getApplicationContext());
            Log.e("application","class2");

        } catch (CleverTapMetaDataNotFoundException e) {
            e.printStackTrace();
        } catch (CleverTapPermissionsNotSatisfied cleverTapPermissionsNotSatisfied) {
            cleverTapPermissionsNotSatisfied.printStackTrace();

    }
    super.onCreate();

}

If i Change the > support version to v4 it will show exception

E/CleverTap: Error checking Google Play services availability
                                                         java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/GoogleApiAvailability;
                                                             at com.clevertap.android.sdk.DeviceInfo.isGooglePlayServicesAvailable(DeviceInfo.java:274)
2

There are 2 best solutions below

0
On BEST ANSWER

Seems like you're on an older library.

The library depends on the Android v4 support library, minimum revision 23.1.1.

Make sure you add this. More information on support libraries can be found here

compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'

I hope it will work for you.

2
On

Did you try giving the permission for the Application? when you install the application to your phone it will automatically turn off the permissions, so you need to give them manually!