3

I want to integrate adjust SDK on my project but I got this error

AdvertisingIdClient: Error while reading from SharedPreferences java.lang.SecurityException: MODE_WORLD_READABLE no longer supported

but I didn't use MODE_WORLD_READABLE anywhere

here my code

    String appToken = getString(R.string.adjust_token);
    String environment = AdjustConfig.ENVIRONMENT_PRODUCTION;
    AdjustConfig config = new AdjustConfig(this, appToken, environment);
    config.setLogLevel(LogLevel.VERBOSE);
    Adjust.onCreate(config);
    registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());

here my gradle

  compile 'com.adjust.sdk:adjust-android:4.14.0'
compile 'com.android.installreferrer:installreferrer:1.0'
hugerde
  • 919
  • 1
  • 12
  • 27
  • have u check this https://stackoverflow.com/questions/39121052/java-lang-securityexception-mode-world-readable-no-longer-supported – AskNilesh Jun 26 '18 at 12:48
  • 1
    @NileshRathod yes but I didn't use MODE_WORLD_READABLE, I think its inside AdvertisingIdClient class and its inside adjust code but I don't know What should I do – hugerde Jun 26 '18 at 13:09
  • @hugerde That is not inside Adjust code. Adjust SDK simply uses Google Play Services dependency to read Advertising Id and information whether user has enabled or disabled tracking. – uerceg Nov 16 '18 at 11:29

2 Answers2

4

I was also facing the same issue in android API 28. I had to update 'com.google.android.gms:play-services' in app\build.gradle file and 'com.google.gms:google-services' in project gradle file with latest releases. Hope it helps.

sAm
  • 585
  • 2
  • 8
  • 23
2

Reason you are seeing this warning is probably because you are using older version of Google Play Services dependency in your app. Which version are you using? Give latest version a shot:

implementation 'com.google.android.gms:play-services-analytics:16.0.5'
uerceg
  • 4,637
  • 6
  • 45
  • 63