首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Kotlin未解决引用: READ_EXTERNAL_STORAGE,棒棒糖,未解决引用: FLAG_ACTIVITY_CLEAR_TASK

Kotlin未解决引用: READ_EXTERNAL_STORAGE,棒棒糖,未解决引用: FLAG_ACTIVITY_CLEAR_TASK
EN

Stack Overflow用户
提问于 2019-09-30 12:01:40
回答 1查看 1.2K关注 0票数 1

我在kotlin版本1.3.41的kotlin项目中遇到了一个问题

未解决的参考资料:我不知道为什么会出现这个问题?我也降低了kotlin版本的等级,但没有效果。

当我运行它时,我会收到错误:

未解决引用: READ_EXTERNAL_STORAGE

  • Unresolved引用: LOLLIPOP

  • Unresolved引用: statusBarColor

  • Unresolved引用: PROVIDERS_CHANGED_ACTION

  • Unresolved引用: finishAffinity

  • Unresolved引用: PROVIDERS_CHANGED_ACTION

  • Unresolved引用: finishAffinity

  • Unresolved引用: FLAG_ACTIVITY_CLEAR_TASK

  • Unresolved引用:O

  • 未解析引用: IMPORTANCE_HIGH

  • Unresolved引用: createNotificationChannel

任何人都可以为我解释这是为什么,并解决它谢谢

代码语言:javascript
复制
    private fun requestReadWritePermissions() {
        TedPermission.with(this@ActivityChooseDocuments)
                .setPermissionListener(this)
                .setDeniedMessage(context!!.getString(R.string.permission_text))
                .setPermissions(READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE,CAMERA)
                .check()
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {}




# Project label gradle #
    buildscript {
    ext.kotlin_version = '1.3.10'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.10"
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
        classpath 'com.google.gms:google-services:4.3.2'
        classpath "org.jetbrains.kotlin:kotlin-android extensions:$kotlin_version"
    }
    }
    allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
    }
    task clean(type: Delete) {
    delete rootProject.buildDir
    }

# App label gradle #
    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'
    apply plugin: 'kotlin-kapt'

    android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.rahman.kotlintaxi"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {
        multiDexEnabled true
    }
    dataBinding {
        enabled = true
    }
    allprojects {
        repositories {
            maven { url 'https://jitpack.io' }
            maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
            maven { url 'https://maven.fabric.io/public' }
            jcenter()
        }
    }

    lintOptions {
        abortOnError false
    }
    androidExtensions {
        experimental = false
    }
    }

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation "org.jetbrains.anko:anko-commons:0.10.1"

    }
    apply plugin: 'com.google.gms.google-services'

    configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
            }
        }

    }
    }
EN

回答 1

Stack Overflow用户

发布于 2019-09-30 12:15:23

不要只使用READ_EXTERNAL_STORAGE。像这样使用Manifest.permission.READ_EXTERNAL_STORAGE

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58167529

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档