【问题标题】:You need to use a different package name because "com.example" is restricted您需要使用不同的包名称,因为“com.example”受到限制
【发布时间】:2016-07-14 11:28:13
【问题描述】:

我已经在这里找到了很多关于这个问题的帖子,但没有一个对我有用。

我使用的是 Android Studio 2.1.2,而且我还有 com.example 域名。在清单或任何其他文件中更改它会导致出现许多错误,而我的 build.gradle 仅显示以下内容:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

有人可以给我一些建议吗,因为我已经花了很多时间在这个应用程序上?在此先感谢:-)

【问题讨论】:

    标签: android-studio google-play domain-name


    【解决方案1】:

    您在问题中显示的是顶级build.gradle

    打开应用程序级别build.gradle(在app 文件夹内)并根据applciationId 更改包名称

    您不需要在代码中的任何地方更改包名称。只需在此处更改它,将生成您的 apk 并使用提供的包名称,而不管您在 src 文件夹中的包是如何命名的。

    【讨论】:

    • 这正是我想要的!非常感谢!
    猜你喜欢
    • 2019-03-26
    • 2020-05-31
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 2018-04-21
    • 1970-01-01
    • 2017-12-19
    • 2015-10-21
    相关资源
    最近更新 更多