Cannot resolve symbol 'WRITE_EXTERNAL_STORAGE'
时间: 2023-10-30 21:42:37 浏览: 96
This error typically occurs when you are trying to use the WRITE_EXTERNAL_STORAGE permission in your Android application but have not declared it in the AndroidManifest.xml file.
To resolve this error, add the following line of code to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
This will declare the WRITE_EXTERNAL_STORAGE permission and allow your application to write to external storage.
相关问题
Cannot resolve symbol 'MANAGE_EXTERNAL_STORAGE'
This error typically occurs when trying to use the MANAGE_EXTERNAL_STORAGE permission in an Android app targeting API level 29 or higher. This permission was introduced in Android 11 and allows an app to manage all files on external storage, including deleting, modifying, and creating new files.
To resolve this error, you can do the following:
1. Make sure your app is targeting API level 30 or higher. The MANAGE_EXTERNAL_STORAGE permission is only available on Android 11 and higher.
2. Add the following permission to your app's AndroidManifest.xml file:
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
3. If you're using Android Studio, make sure you have the latest version installed and that your project is using the latest build tools.
4. If you're still encountering the error, try cleaning and rebuilding your project.
Note that the MANAGE_EXTERNAL_STORAGE permission is considered a sensitive permission and requires a special declaration in your app's manifest file. You'll also need to provide a justification for why your app needs this permission when submitting it to the Google Play Store.
Cannot resolve symbol 'REQUEST_TAKE_PHOTO'
"REQUEST_TAKE_PHOTO" 标识符无法解析。
这个错误消息表明编译器无法识别 "REQUEST_TAKE_PHOTO" 这个标识符。它可能是因为该标识符没有定义或者它在当前的作用域内不可见。如果这个标识符是你自己定义的,请确保在合适的位置定义了它,并且在使用前导入了它所在的包或者类。
阅读全文