小编kis*_*ara的帖子

java.lang.SecurityException:不再支持MODE_WORLD_READABLE

例外情况仅发生在Android 7.0 Nougat(模拟器)设备中.

java.lang.SecurityException:不再支持MODE_WORLD_READABLE

我的代码:

public void SessionMaintainence(Context context) {
    this.context = context;
    preferences = context.getSharedPreferences(PREF_NAME, Context.MODE_WORLD_READABLE);
    editor = preferences.edit();
    editor.commit();
}
Run Code Online (Sandbox Code Playgroud)

logcat的:

> E/AndroidRuntime: FATAL EXCEPTION: main
>                                                  Process: burpp.av.feedback, PID: 2796
>                                                  java.lang.RuntimeException: Unable to create application
> burpp.av.feedback.FeedbackApplication: java.lang.SecurityException:
> MODE_WORLD_READABLE no longer supported
>                                                      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5364)
>                                                      at android.app.ActivityThread.-wrap2(ActivityThread.java)
>                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
>                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
>                                                      at android.os.Looper.loop(Looper.java:154)
>                                                      at android.app.ActivityThread.main(ActivityThread.java:6077)
>                                                      at java.lang.reflect.Method.invoke(Native Method)
>                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
>                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
>                                                   Caused by: java.lang.SecurityException: MODE_WORLD_READABLE …
Run Code Online (Sandbox Code Playgroud)

android android-securityexception android-sharedpreferences android-7.0-nougat

23
推荐指数
1
解决办法
3万
查看次数

Android Studio 1.5.1在APK META-INF/NOTICE.txt中复制的重复文件commons-codec-1.9.jar ...?

commons-codec-1.9.jar ...在APK META-INF/NOTICE.txt中复制的重复文件

> Error:Execution failed for task
> ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files
> copied in APK META-INF/NOTICE.txt     File1:
> C:\Users\nandkishor.mewara\AndroidStudioProjects\New folder
> (2)\CityRetails\app\libs\commons-logging-1.2.jar  File2:
> C:\Users\nandkishor.mewara\AndroidStudioProjects\New folder
> (2)\CityRetails\app\libs\commons-codec-1.9.jar
Run Code Online (Sandbox Code Playgroud)

java apache android

4
推荐指数
1
解决办法
2016
查看次数

更新android studio 3.1后运行app时出错

我更新android studio 3.1我知道这是重复的问题,但我不知道如何解决它,请帮助我

错误:-

程序类型已存在:android.support.v13.view.DragAndDropPermissionsCompat消息{kind = ERROR,text =程序类型已存在:android.support.v13.view.DragAndDropPermissionsCompat,sources = [未知源文件],工具名称=可选.的(D8)}

的build.gradle

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'

        }
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)

的build.gradle(APP:模块)

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.xyz"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes { …
Run Code Online (Sandbox Code Playgroud)

android android-studio android-gradle-plugin

2
推荐指数
1
解决办法
1319
查看次数