Android: Loading A Library And Using It Only For Development Branch Not For Release
Solution 1:
So for Debug it is working fine but when I am building Store-Release/ Development-Release apk it is not able to compile ApplicationWithDebugLibrary.java, as I am using the library, which is not compiled in gradle file for release flavour
By logic there's no way to magically remove library your code uses and still have all remainings properly compile as there're simply missing symbols. So you must create "dummy" library, with the same API as your debug one but with no methods body. Alternatively you can wrap your lib with some code that can be later swapped for production with version that uses no library dependencies.
Android Gradle plugin can help building with different version of dependencies based of what type of build it is:
The compile configuration is used to compile the main application. Everything in it is added to the compilation classpath and also packaged in the final APK. There are other possible configurations to add dependencies to:
- compile: main application
- androidTestCompile: test application
- debugCompile: debug Build Type
- releaseCompile: release Build Type.
Post a Comment for "Android: Loading A Library And Using It Only For Development Branch Not For Release"