Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1.3编译不通过,提示Missing 'package' key attribute on element package #26

Closed
WangPe1n opened this issue Jun 3, 2021 · 9 comments

Comments

@WangPe1n
Copy link

WangPe1n commented Jun 3, 2021

Error:
Missing 'package' key attribute on element package at [com.github.gzu-liyujiang:Android_CN_OAID:4.1.3] AndroidManifest.xml

image

@liyujiang-gzu
Copy link
Member

Error:
Missing 'package' key attribute on element package at [com.github.gzu-liyujiang:Android_CN_OAID:4.1.3] AndroidManifest.xml

image

指向的是清单文件中这两处合并失败,你的Android Studio版本是多少?我这里没问题:
image

@liyujiang-gzu
Copy link
Member

liyujiang-gzu commented Jun 4, 2021

那两句是用来兼容Android 11 的谷歌广告ID的,需要 Gradle 插件 版本至少 4.0.1才支持<queries><package /></queries>

@liyujiang-gzu
Copy link
Member

liyujiang-gzu commented Jun 4, 2021

不能升级到目前的最新版本4.2.1的Android Studio 及 Gradle插件的话,可以把Gradle插件升级到4.0.1:

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
    }
}

微信截图_20210604150203

@WangPe1n
Copy link
Author

WangPe1n commented Jun 4, 2021

是的 我把gradle升级到了6.7.1 然后gradle插件升级到了4.2.1 问题解决了

@WangPe1n WangPe1n closed this as completed Jun 4, 2021
@liyujiang-gzu
Copy link
Member

liyujiang-gzu commented Jun 4, 2021

实在不能升级Gradle 插件版本的话。可以在你APP的Manifest里加入试试下面这个移除:

<queries tools:node="remove" />

@WangPe1n
Copy link
Author

WangPe1n commented Jun 4, 2021

实在不能升级Gradle 插件版本的话。可以在你APP的Manifest里加入试试下面这个移除:

<queries tools:node="remove" />

好的 谢谢

@stevenwsg
Copy link

实在不能升级Gradle 插件版本的话。可以在你APP的Manifest里加入试试下面这个移除:

<queries tools:node="remove" />

这个具体加在那个位置啊

@liyujiang-gzu
Copy link
Member

实在不能升级Gradle 插件版本的话。可以在你APP的Manifest里加入试试下面这个移除:

<queries tools:node="remove" />

这个具体加在那个位置啊

你自己的APP的AndroidManiest.xmlmanifest节点,如:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <queries tools:node="remove" />
    
    <application>...</application>
</manifest>

@ka0816
Copy link

ka0816 commented May 23, 2022

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants