openweathermap-java-api icon indicating copy to clipboard operation
openweathermap-java-api copied to clipboard

Compilation breaks when compiling release build (with proguard) because of lombok

Open mama-git opened this issue 7 years ago • 1 comments

It's always failing in :app:transformClassesAndResourcesWithProguardForStagingRelease Adding -keep class lombok.** { *; } in the proguard file did not help.

11:15:06.286 [ERROR] [system.err] Warning: there were 728 unresolved references to classes or interfaces. 11:15:06.286 [ERROR] [system.err] You may need to add missing library jars or update their versions. 11:15:06.286 [ERROR] [system.err] If your code works fine without the missing classes, you can suppress 11:15:06.286 [ERROR] [system.err] the warnings with '-dontwarn' options. 11:15:06.286 [ERROR] [system.err] (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) 11:15:06.286 [ERROR] [system.err] Warning: there were 2 unresolved references to program class members. 11:15:06.286 [ERROR] [system.err] Your input classes appear to be inconsistent. 11:15:06.286 [ERROR] [system.err] You may need to recompile the code. 11:15:06.286 [ERROR] [system.err] (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)

in the attached file you can find all the warnings about the classes and interfaces that cannot be found. lombok_warnings.txt

Am I importing your library incorrectly?

In my build.gradle file I imported the api like this: dependencies { ... api 'org.openweathermap.java-api:api-core:1.0' }

Edit: by using -dontwarn lombok.** I can build the apk, but then at runtime when querying daily forecasts, the DailyForecast.getWeather() method returns null. This does not happen with the debug build or by not using proguard in the release build.

mama-git avatar Dec 29 '17 10:12 mama-git

@mama-git Hello. I'm sorry, but I don't have any experience with proguard. Probably you need to ask someone on Stackoverflow or Quora.

xSAVIKx avatar Jan 02 '18 19:01 xSAVIKx