While trying to use Maven for building Android projects I recognized that the maven-android-plugin doesn't autogenerate the BuildConfig class during build time. I have found a ticket regarding that problem and a Google Groups thread.
Issue: http://code.google.com/p/maven-android-plugin/issues/detail?id=275
Google Groups: http://groups.google.com/group/maven-android-developers/browse_thread/thread/cc74267bbb7baebb/4e63b710513bb535?lnk=gst&q=BuildConfig#4e63b710513bb535
The quick hack in the issues thread suggests creating another micro maven project to set the BuildConfig.DEBUG variable during build time with a profile switch. This would force me to build a multi module project for every single little application.
The suggestion in the Google Groups thread sounds ok for me (executing the Ant Task from the SDK to generate the BuildConfig class) but after digging through the build.xml and trying to get this work I gave up.
Has someone got a practical working solution for the BuildConfig problem with maven+android?
Thanks to Jake Wharton and Manfred Moser, BuildConfig generation has been supported since Android Maven Plugin 3.3.2.
Check out changelog for 3.3.2 release here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With