14
android {
    enforceUniquePackageName = false
}

"enforceUniquePackageName" works with the gradle version:

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'
}

However, if I change the gradle version to 3.0.0

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
}

I get:

Could not set unknown property 'enforceUniquePackageName' for object of type com.android.build.gradle.AppExtension. Open File

If 'enforceUniquePackageName' property is deprecated, then what would be the alternative option?

jclova
  • 5,466
  • 16
  • 52
  • 78
  • 2
    If I had to guess, they got rid of it entirely with no replacement. [Error messages from two years ago said that this feature was temporary](https://stackoverflow.com/q/28417283/115145). – CommonsWare Aug 01 '17 at 19:27
  • Noooooo!!! They removed such a nice feature. I now need to rename packages and all JNI method names with it. – jclova Aug 08 '17 at 16:35
  • They talked about this briefly at the '18 I/O... IIRC it was either this session - https://events.google.com/io2018/schedule/?section=may-8&sid=72e67d84-07ba-4535-9a71-95adc3417436&topic=android%26play&type=sessions - or this one - https://events.google.com/io2018/schedule/?section=may-8&sid=a6aca269-b30c-456f-a730-65b2431f2ef4&topic=android%26play&type=sessions – jesses.co.tt May 29 '19 at 14:31

1 Answers1

1

This was renamed in AGP 3.4: https://developer.android.com/studio/releases/gradle-plugin#agp-7-1-stable-known-issues to uniquePackageNames

kenyee
  • 2,309
  • 1
  • 24
  • 32