I have a MyLocationService
library, which has dependency from huawei_location_service
.Inside I have HMSLocationService
class which is the only one using huawei_location_service
classes and I use relfection to access that class. Meaning is, if we run app on Huawei and if there is dependency from huawei_location_service
, I will get location, otherwise will not. And application should run perfectly on non-hauwei devices without dependency from huawei_location_service
.
So when I build MyLocationService.aar I removed huawei_location_service
dependency from it's pom file. After that I created a new application and added dependency from MyLocationService.aar. When I check dependencies with command gradlew app:dependencies
I don't see any dependency from huawei, but when I create an apk and analyze it, in classes.dex there are classes from huawei_location_service
.
Question: How it is possible? And is there any other way to achieve what I want?
P.S. I analyzed also MyLocationService.aar, didn't find any huawei dependency. Is there another way to check dependencies of *.aar files instead of pom or analyzing tool of android studio?