'Gradle Error: No value has been specified for property 'buildConfigPackageName'

When I attempt to build my android project after updating to the latest version of android studio/developer tools I have been getting these errors:

[Fatal Error] :1:38: A pseudo attribute name is expected.

FAILED

FAILURE: Build failed with an exception.

  • What went wrong: A problem was found with the configuration of task ':apoAppAndroid:generatePharmoreDebugBuildConfig'. No value has been specified for property 'buildConfigPackageName'.

I though Package Name had been deprecated, what am I doing wrong?

Here is a shortened version of my gradle file

apply plugin: 'android'

android {
compileSdkVersion 18
buildToolsVersion "20"

defaultConfig {
    applicationId "com.bluechilli.apoappandroid"
    minSdkVersion 16
    targetSdkVersion 19
    versionCode 19

}

signingConfigs {
    debug {
        storeFile file("../../../.android/debug.keystore")
        storePassword "android"
        keyAlias "androiddebugkey"
        keyPassword "android"
    }
}


buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

productFlavors{
    basic{
        applicationId "com.bluechilli.basic"

    }
    pharmore{
        applicationId "com.bluechilli.pharmore"
    }

}
}


Solution 1:[1]

Best option is to create a fresh project and transfer all your code over (excluding your old package name). I had similar problems before, but resolved most with just copying over my code to a new project. Hope it helps!

Solution 2:[2]

in fact you don't need to define packagename in AndroidManifest , just add it in build.gradle .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 HorizonBloom
Solution 2 SadieYu