0

Log cat: FATAL EXCEPTION: main Process: com.yourpackagename, PID: 8102 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yourpackagename/com.yourpackagename.TestActivity}: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported at android.app.ContextImpl.checkMode(ContextImpl.java:2134) at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:354) at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:349) at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:164) at com.basewin.utils.GlobalTransData.init(GlobalTransData.java:74) at com.basewin.services.ServiceManager.init(ServiceManager.java:70) at com.yourpackagename.TestActivity.onCreate(TestActivity.java:25) at android.app.Activity.performCreate(Activity.java:6679) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6119)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

Rogi Yoyo
  • 1
  • 1
  • GlobalTransData.java:74-> this.mPrefs = this.mContext.getSharedPreferences("global_data", 1); – Rogi Yoyo Jun 22 '17 at 09:25
  • TestActivity.java:25-> ServiceManager.getInstence().init(getApplicationContext()); – Rogi Yoyo Jun 22 '17 at 09:25
  • GlobalTransData.java:43-> mPrefs = mContext.getSharedPreferences(PREFERENCES,Context.MODE_PRIVATE); – Rogi Yoyo Jun 22 '17 at 09:26
  • A) dont put more information into comments ... always always always add stuff into your question B) but before writing up a question, put that exception message into you favorite search engine. It took me **less** time to find that DUP than it took me to read your question – GhostCat Jun 22 '17 at 09:27
  • Sorry, I do not have much experience with forums and I have been struggling with this exception for some time and I do not see how to solve it. – Rogi Yoyo Jun 22 '17 at 09:32
  • Simply read the duplicated answer. What you are trying to do **is not supported** any more. You dont have global writeable files. End of story. You have to step back, look at your requirements and find another way to do what needs to be done. – GhostCat Jun 22 '17 at 09:33
  • This project is part of an already existing project that works fine on the device, so I want to change it for other purposes, but I'm conditioned by this line: ServiceManager.getInstence () .init (getApplicationContext ()); Which calls the others mentioned above and actually initializes device server here. – Rogi Yoyo Jun 22 '17 at 09:40
  • Lets put it that we: if some more Android guru comes by and states he has a solution; I will have no problem re-opening this question. But until then, I will things like they are. – GhostCat Jun 22 '17 at 09:41
  • *"This project is part of an already existing project that works fine on the device"* - I think that the point is that the code *won't* work on newer devices. And the reason that it won't work is that the feature the old code was relying has been deemed to be **insecure**. If you want that code to work on newer devices, you will need to change the part that relies on this feature. – Stephen C Jun 22 '17 at 10:00

0 Answers0