環境
- OS
- windows
- IDE
- AndroidStuido
対象コマンド
flutterFire configure
対象エラー
Which Android application id (or package name) do you want to use for this configuration, e.g. 'com.example.app'?
i Firebase android app is not registered on Firebase project your_project.
⠼ Registering new Firebase android app on Firebase project your_project.
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase apps:create android your_project (android) --package-name= --json --project=your_project
ERROR: Package name for Android app cannot be empty
エラー詳細
ERROR: Package name for Android app cannot be empty
どうやらパッケージ名が空らしい。
確認箇所
1. android/app/src/main/AndroidManifest.xml
- 私はmanifestタグにpackage名がなかったので追加
- android:labelをパッケージ名とそろえる
android/app/src/main/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.orgname.my_app_name"> // 追加
<application
android:label="com.your.orgname.my_app_name"
2. android/app/src/debug/AndroidManifest.xml
- manifestタグにpackageを追加
android/app/src/debug/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.orgname.my_app_name">
3. android/app/src/profile/AndroidManifest.xml
- manifestタグにpackageを追加
android/app/src/profile/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.orgname.my_app_name">
4. android/app/build.gradle
- namespace
- applicationId
android/app/build.gradle
android {
namespace = "com.your.orgname.my_app_name"
defaultConfig {
applicationId = "com.your.orgname.my_app_name"
5. android/app/src/main/kotlin/com.your.orgname.my_app_name/MainActivity.kt
- package インポート
android/app/src/main/kotlin/com.your.orgname.my_app_name/MainActivity.kt
package com.your.orgname.my_app_name
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity()