在使用Visual Studio Code创建Ffltter应用程序并try 通过Google Play应用store 控制台将其上传到Google Play应用store 时,我收到以下错误:
"com.Example"的使用受到限制.请使用其他包名
这与使用的默认名称有关,该名称包括示例部件.网上有很多关于包名的相关性、命名约定以及如何在Android Studio中更新包名的指南.
我完全不知道如何在Android Visual Studio代码中更新它……
在使用Visual Studio Code创建Ffltter应用程序并try 通过Google Play应用store 控制台将其上传到Google Play应用store 时,我收到以下错误:
"com.Example"的使用受到限制.请使用其他包名
这与使用的默认名称有关,该名称包括示例部件.网上有很多关于包名的相关性、命名约定以及如何在Android Studio中更新包名的指南.
我完全不知道如何在Android Visual Studio代码中更新它……
一些在线指南建议只更改位于apppath/android/app/的build.gradle中出现的两次"com.ample"
从…
android {
namespace "com.example.XXX"
[...]
defaultConfig {
applicationId "com.example.XXX"
至
android {
namespace "com.newname.XXX"
[...]
defaultConfig {
applicationId "com.newname.XXX"
However: While, after 1) saving, 2) flutter clean, 3) flutter build appbundle, the new version might actually be accepted by the Play S至re, there might be issues with running the app. This is because the package name has not been updated across all occurrences in the code. Under Visual Studio Code, I was not able 至 use "refac至r" features of in Android Studio, that seem 至 be able 至 fully update the package name .
相反,在Visual Studio代码下,您可以使用以下命令替换所有出现的代码:编辑-&>在文件中查找,搜索"com.Example".
Once "example" has been replaced by "newname" for all of those occurrences, my app was able 至 both start correctly and be accepted by the Play S至re.
希望这能帮助一些正在与同样问题作斗争的人:)