Android Manifest missing the package name line?

100 Views Asked by At

I was trying to set up firebase, which needed the package name of my current app, except when I went to the android manifest, I did not find the package name line, which shoud be in the second line, is that normal?

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="audio_inspect_app"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
    </application>

Usually it's :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.example.myapp">
<application ... >
 ...
</application>

Not sure what to do about this?

4

There are 4 best solutions below

0
Murtaza On

The package name is in your gradle file of your project, not in manifest.

 defaultConfig {
        applicationId "com.example.myapp"
        ...
    }
0
Android dev On

Please check your build.gradle file for package name. Here is the gradle file example

defaultConfig {
    applicationId "com.example.app"
    minSdk 24
    targetSdk 33
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Package name and applicationId both are same.

0
MãĴď On

is this a flutter project?. if so you can find it in the android =>app=>src=>build.gradle. Scroll down to the android tag. Namespace should be your package name. yes it's normal I checked mine and got the same result as you.

0
Roshana Pitigala On

Not having the package attribute in the manifest is not an issue. The documentation states,

In the Gradle-based build system, starting with AGP 7.3, don't set the package value in the source manifest file directly.

It can now be found in the gradle file. Once again the documentation states,

Your application ID is defined by the applicationId property in your module's build.gradle file, as shown here.

android {
    defaultConfig {
        applicationId "com.example.myapp"
        ...
    }
    ...
}