【发布时间】:2021-10-16 01:39:03
【问题描述】:
注意:我一直在研究这个项目,并时不时地构建它。它工作正常,直到最近我的所有项目都开始显示“缺少权限错误”,但我已经在 AndroidManifest 文件中提到了项目的权限。
项目 1:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.firstproject">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
////other code
</manifest>
missing permission error in first project
为什么我需要权限/权限检查:
build.gradle (:app)(第一个项目):
dependencies {
implementation platform('com.google.firebase:firebase-bom:28.1.0')
implementation "androidx.cardview:cardview:1.0.0"
implementation "com.google.android.material:material:1.3.0"
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.firebaseui:firebase-ui-database:6.2.1'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.karumi:dexter:6.1.2'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.firebase:geofire-android:3.0.0'
}
我的第二个项目出现同样的错误。
第二个项目: missing permission error in second project
AndroidManifest.xml 文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.driver">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
//other stuff
项目构建日志:
Starting Gradle Daemon...
Gradle Daemon started in 3 s 90 ms
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguid/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 34s
如果我运行此项目时出现以下错误会发生什么: 它不要求我的许可,但在设置 - > 应用程序中显示许可 permission showing in the setting
我已经尝试过的:
- 重建项目
- 清理项目
- 升级 Gradle
- 删除项目并构建备份版本(一个提交还原,因为我使用 github)
【问题讨论】:
标签: java android firebase gradle android-manifest