【问题标题】:package name change but not working in gradle包名称更改但在 gradle 中不起作用
【发布时间】:2018-07-07 10:39:30
【问题描述】:
package com.abhimathgame.shubham.mindsharp;

在build.gradle中手动更改包名

 defaultConfig {
    applicationId "com.abhimathgame.shubham.mindsharp"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}

然后我同步 gradle 但它返回错误并且 whrn 正在使用

applicationId "com.example.shubham.mindsharp"

没关系,但不在 Playstore 上发布 Error Image for more help

【问题讨论】:

  • 检查您的AndroidManifest.xml 文件
  • 您能告诉我您使用的是哪个 Build Variant 吗?在您左侧的侧标签下方。
  • 你能重新检查 Android Manifest 文件中的“package”属性吗?
  • 只是在 build.gradle 中更改,将不起作用。我所做的是搜索旧包名(这通常用于Java Class,Manifest和/或Strings.xml),只需替换找到旧包名的每个地方。
  • schemas.android.com/apk/res/android" package="com.abhimathgame.shubham.mindsharp">

标签: android listview android-studio android-fragments


【解决方案1】:

首先尝试将谷歌服务更新到最新版本。 你也用flavors吗?

也可能是您正在使用 post 中指出的 New Relic?它指的是tutorial,其中准确解释了问题的性质:

google_services.json 必须位于 :app 模块的根目录中 而不是在 buildType/productVariant 文件夹中,所以 Gradle 不能 通过文件夹放置自动为您处理。

【讨论】:

    【解决方案2】:

    确保您的包名在所有地方都相同。此外,如果您在项目中添加了来自 firebase 的 google-services.json 文件,请确保添加的包名正确。 希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-10
      • 2019-01-15
      • 1970-01-01
      • 2017-06-26
      • 2014-06-16
      • 1970-01-01
      • 2022-07-15
      • 1970-01-01
      相关资源
      最近更新 更多