- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在使用 kotlin 版本 1.3.41 的 kotlin 项目中遇到问题
Unresolved reference :我无法找出为什么会出现该问题?。我也降级了 kotlin 版本但没有效果。
当我运行它时,我收到错误:
任何人都可以为我解释为什么会这样并解决它谢谢
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'
}
}
}
}
最佳答案
不要只使用 READ_EXTERNAL_STORAGE
。像这样使用 Manifest.permission.READ_EXTERNAL_STORAGE
关于android - Kotlin Unresolved reference : READ_EXTERNAL_STORAGE, LOLLIPOP, Unresolved reference :FLAG_ACTIVITY_CLEAR_TASK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58167529/
这个问题在这里已经有了答案: Writing external storage doesn't work until I restart the application on Android M (
我正在尝试使用 Android 6.0 请求运行时权限。这是我的代码: private void enablePermission() { String[] PERMISSIONS = { M
我正在尝试从存储中读取图像路径,但我一直在此处收到 SecurityException: Caused by: java.lang.SecurityException: Permission Deni
当用户接受READ_EXTERNAL_STORAGE权限时,权限授予成功(在debug中可以看到)。但是在重新启动应用程序之前无法读取目录(dir.canRead() 在调试中为 false)。 mi
我正在尝试创建一个简单的应用程序,它可以从 Gallery 应用程序获取图像并将其显示在 imageButton 上。我正在运行 Android 5.0.1 的手机上使用 API 21 进行测试。不幸
我正在模拟器上测试我的应用。我有一个导出功能,可以在外部存储的下载目录中创建和写入文件。我还有一个导入功能,可以从外部存储的下载目录中读取文件。 来自 Android documentation :
我正在尝试将照片发送到服务器,但我无法仅在 Android 10 上访问该照片。发出 READ_EXTERNAL_STORAGE 请求,单击“允许”,在设置中,允许访问存储。 list fragm
自从将 Cordova 应用程序移至 Android Studio 后,我尝试在它上打开相机,但现在它已停止工作。 我没有收到任何权限弹出窗口,也没有在用户端显示任何其他内容。 我在 Android
我正在尝试获取设备上所有图像的列表。实现这一目标的关键命令是查询命令: Cursor cursor = getContentResolver().query( M
我正在制作画廊。 我得到了以下异常 Caused by: java.lang.SecurityException: Permission Denial: reading com.android.pro
第一次在这里提问。 无论如何,正如标题所说,我正在尝试将我的应用程序转换市场。 当我尝试上传已签名的 apk 时,出现错误: Upload failed Duplicate declarations
我在我的应用程序中使用 MediaStore 类并遇到以下错误 (logcat), E/DatabaseUtils: Writing exception to parcel java.lang.Sec
声明就够了吗?还是我也必须声明 ? Javadocs 省略了这一重要信息。 最佳答案 最好是显式地声明这两个权限,但仅声明 android.permission.WRITE_EXTERNAL_STOR
我正在尝试访问用户设备上的媒体文件(音乐)来播放它们;一个简单的“hello world”——音乐播放器应用。 我遵循了一些教程,它们基本上给出了相同的代码。但这行不通;它一直在崩溃并告诉我: err
在 androidmanifest.xml 我有: 在 build.gradle 我有: android { compileSdkVersion 23 buildTools
我已经阅读了所有类似的问题,但是找不到解决方案。这是android 10。 我需要你的帮助file.isFile()返回true。 但是file.canRead()返回false。因此,FileInp
我想检查我是否需要 Manifest.permission.READ_EXTERNAL_STORAGE 来读取给定的 Uri。 这是正确处理传入 Intent 到我的应用程序所必需的。例如,如果我从
我有一个曾经在 Delphi Seattle 创建的项目,现在我想搬到 Delphi Rio。我使用 findfirst/findnext 读取外部 SD 卡上的目录结构 i := findfir
当 Android 4.1 JellyBean (API 16) 在 Google I/O 上发布时,它引入了以下权限: READ_EXTERNAL_STORAGE Provides protecte
我的应用程序面向 api 级别 32。在 Android 13 设备上运行时,ActivityResultContracts.RequestMultiplePermissions() 始终返回 PER
我是一名优秀的程序员,十分优秀!