Stop generating javax.annotation source files in Android APK

359 Views Asked by At

I am using retrofit library and while generating the APK the apk contains java source files under javax.annotations in the APK.

I tried using proguard and minifyEnabled, Still the java source files persist in the extracted APK.

Is there any way to disable generating the java source files?

1

There are 1 best solutions below

0
Prasanna Anbazhagan On BEST ANSWER

There is an issue with react-native dependency.

If we want to avoid those files getting in to APK, then we can exclude those files. In my case I did

packagingOptions {
        exclude 'javax/annotation/*'
        exclude 'javax/annotation/meta/*'
        exclude 'javax/annotation/concurrent/*'
    }