如何使用命名空间“com.example”在flutter中创建应用程序?

问题描述 投票:0回答:1

我已经使用 vscode 创建了一个 flutter 应用程序,现在我尝试将捆绑包上传到 Google Play 商店,但出现错误:

You need to use a different package name because "com.example" is restricted.

我没有域名,那么如何在不更改 app/build.gradle 文件中的命名空间的情况下执行此操作,或者我是否需要拥有域名?

flutter dart
1个回答
0
投票

有一个非常方便的包/CLI 工具,称为 rename。 您可以使用它来修改您的包 ID 和应用程序名称。

使用示例(来自文档):

rename setBundleId --targets android --value "com.example.bundleId"
© www.soinside.com 2019 - 2024. All rights reserved.