I’m building app with expo-location and react-native-unimodules.
Android debug build succeeds, but Android release build (assembleRelease) fails with this error message.
Note: there were 59 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Warning: there were 97 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 2 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile the code.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
Thread(Tasks limiter_1): destruction
> Task :app:transformClassesAndResourcesWithProguardForRelease FAILED
The warnings are below.
Warning: io.nlopez.smartlocation.rx.ObservableFactory$1: can't find superclass or interface rx.functions.Action0
Warning: io.nlopez.smartlocation.rx.ObservableFactory$2: can't find superclass or interface rx.Observable$OnSubscribe
Warning: io.nlopez.smartlocation.rx.ObservableFactory$3: can't find superclass or interface rx.functions.Action0
Warning: io.nlopez.smartlocation.rx.ObservableFactory$4: can't find superclass or interface rx.Observable$OnSubscribe
Warning: io.nlopez.smartlocation.rx.ObservableFactory$5: can't find superclass or interface rx.functions.Action0
Warning: io.nlopez.smartlocation.rx.ObservableFactory$6: can't find superclass or interface rx.Observable$OnSubscribe
Warning: io.nlopez.smartlocation.rx.ObservableFactory$7: can't find superclass or interface rx.Observable$OnSubscribe
Warning: io.nlopez.smartlocation.rx.ObservableFactory$8: can't find superclass or interface rx.Observable$OnSubscribe
Warning: io.nlopez.smartlocation.activity.ActivityStore: can't find referenced method 'int getVersionCode()' in program class com.google.android.gms.location.DetectedActivity
Warning: io.nlopez.smartlocation.activity.ActivityStore: can't find referenced method 'DetectedActivity(int,int,int)' in program class com.google.android.gms.location.DetectedActivity
Warning: io.nlopez.smartlocation.rx.ObservableFactory: can't find referenced class rx.Observable$OnSubscribe
Warning: io.nlopez.smartlocation.rx.ObservableFactory: can't find referenced class rx.Observable
Warning: io.nlopez.smartlocation.rx.ObservableFactory: can't find referenced class rx.Observable
...
Maybe it is proguard issue and I added below to my android/app/proguard-rules.pro.
(io.nlopez.smartlocation seems be dependency of expo-location)
-keep class io.nlopez.** { *; }
-dontwarn io.nlopez.**
Then, build succeeds and I can run the app, but it shows error below on executing Location.watchHeadingAsync
default.watchDeviceHeading' is undefined
It seems to fail to resolve expo-location lib on only release build.
Does anyone have ideas to solve this?
Thanks!