简体   繁体   English

Android 未编译,因为清单“错误:找不到符号类清单”

[英]Android not compiling because manifest 'error: cannot find symbol class Manifest'

When i compile my project in Android Studio i have this error当我在 Android Studio 中编译我的项目时出现此错误

error: cannot find symbol class Manifest错误:找不到符号类清单

but when i remove this line 'import tld.domain.appname.Manifest;', everything seems to work fine.但是当我删除这一行“import tld.domain.appname.Manifest;”时,一切似乎都正常。 In other Android Studios, the compilation of the project works correctly with the same import.在其他 Android Studio 中,项目的编译在相同的导入下正常工作。

The import is required for this block of code此代码块需要导入

int permissionCheck = ContextCompat.checkSelfPermission(mView.getTarget(), Manifest.permission.MANAGE_ACCOUNTS);
   if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
       ActivityCompat.requestPermissions(mView.getTarget(),
               new String[]{Manifest.permission.MANAGE_ACCOUNTS},
               Constants.PERMISSION_REQUEST_MANAGE_ACCOUNTS);
   }

The permission i want to reference is bellow.我想参考的许可如下。

<permission android:name="android.permission.MANAGE_ACCOUNTS" />

The projects are exactly the same, i have no clue what's the problem.项目完全一样,我不知道有什么问题。 Thank you in advance.先感谢您。

截屏

Try to import manifest by尝试通过以下方式导入清单

import android.Manifest导入 android.Manifest

And use android.manifest in your code instead of just Manifest.并在您的代码中使用 android.manifest 而不仅仅是 Manifest。

所以我在 build.gradle(module:app) 上更新了 play services plus 和 play services auth 的版本,问题就消失了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM