我在我的应用程序中集成 claverTap,我遵循了集成文档,但是当我运行我的应用程序时,出现以下错误:-
com.clevertap.android.sdk.exceptions.CleverTapPermissionsNotSatisfied:所需权限:android.permission.INTERNET
问题,即使我也在 AndroidManifest.xml 文件中添加了互联网权限,
应用程序类代码是
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();
}
如果我将 > 支持版本更改为 v4,它将显示异常
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)