I want to create a library (mylib.aar) that gets Android advertise ID.
in base project its needs dependencies like below:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'] )
implementation 'com.android.support:appcompat-v7:25.+'
implementation 'com.google.android.gms:play-services-ads:9.2.1'
}
and it works fine!
the PROBLEM is when i create a release *.aar from the library like the image below and then use the exported mylib.aar in a sample project its not working!
this is how I create the release mylib.aar :
as I said, the new app displays unfortunately has stopped and error it shows me is:
java.lang.NoClassDefFoundError: com.google.android.gms.common.GoogleApiAvailability
how can i solve this?
NOTE: one way is importing *.jar file of the dependency you want and read it from gradle,its working but there is no complete google-play-services.jar for creating AdID