I had implemented Google Native Ads as given in Native Ads
It is working perfect in all devices except Android 4.x version. The crash log in console is
Non-fatal Exception: java.lang.IllegalArgumentException: Optimized data directory /storage/emulated/0/Android/data/com.myapp/cache is not owned by the current user. Shared storage cannot protect your application from code injection attacks.
at dalvik.system.DexFile.(DexFile.java:100)
at dalvik.system.DexFile.loadDex + 149(DexFile.java:149)
at dalvik.system.DexPathList.loadDexFile + 251(DexPathList.java:251)
at dalvik.system.DexPathList.makeDexElements + 219(DexPathList.java:219)
at dalvik.system.DexPathList.(DexPathList.java:96)
at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:56)
at dalvik.system.DexClassLoader.(DexClassLoader.java:57)
at ir.b + 31(ir.java:31)
at ir.a + 5(ir.java:5)
at iu.a + 1(iu.java:1)
at com.google.android.gms.ads.internal.ag.run + 5(ag.java:5)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1080(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 573(ThreadPoolExecutor.java:573)
at java.lang.Thread.run + 856(Thread.java:856)
From Above crash it shows as Optimized data directory /storage/emulated/0/Android/data/com.myapp/cache is not owned by the current user. Shared storage cannot protect your application from code injection attacks
I had search related question Android DexClassLoader error, 'optimized data directory .. not owned by current user' but that is too old and not related to Admob. If I remove Native Ad related code then it is running else it crash and simply log above crash.
Please note my app was working good with same nativeAd code before 13th Aug 2019. after that its not working with NativeAd code.
Please help.