Error: attribute 'package' in <manifest> tag is not a valid Android package name

In my Case, I have updated the Android studio to version 3.5.3, and while project setup, by mistake I have added applicationIdSuffix = kotlin_version, so this is what causing the problem.

So simply removing this line helped me to fix this issue.


Change applicationId "dndtools" to applicationId "com.dndtools.android.dndtools".

applicationId in your build.gradle file is what is used as the real package, that's why you can see it in the merged manfiest as well. Update it to match the one you have in your Android Manfiest and it should work fine.

As for why it's an invalid package - it needs to have at least one dot in it to be installable on Android.


in my case, i build app use default config

compileSdkVersion 30

defaultConfig {
    applicationId "com.webview.app"
    minSdkVersion 23
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    applicationIdSuffix kotlin_version
}

when i add productFlavors

  flavorDimensions "default"
  productFlavors {
    test01{
        dimension "default"
        applicationIdSuffix ".test"
        versionNameSuffix "-test00"
    }

    test01{
        dimension "default"
        applicationIdSuffix ".test"
        versionNameSuffix "-test01"
    }

    test01{
        dimension "default"
        applicationIdSuffix ".test"
        versionNameSuffix "-test02"
    }
}

then i'm runing my app, i got this message

tag is not a valid Android package name: 'com.webview.app.1.4.21.jb'

i think the problem shoud be number and point(.) can not be package name, so i delete code

applicationIdSuffix kotlin_version

it's work for me, because kotlin_version value it's ext.kotlin_version = "1.4.21", when my appid contain number and point(.) it cannot working. in android the appid(pacakege name) should be like this 'come.domain.project' it is reverse domain name.


My problem was with uncorrect naming of the package id. I put something like com.example.3d. You can't start with the number like 3d.

Tags:

Android

Aapt2