Essent / nativescript-urban-airship

Urban airship plugin interface for NativeScript
Other
6 stars 3 forks source link

Android Error NoClassDefFoundError #19

Open appdevsa opened 5 years ago

appdevsa commented 5 years ago

I've installed the plugin and followed the instructions on my Angular NativeScript application. It works fine on iOS. But running Android I get this error:

NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf; at com.google.android.gms.location.LocationServices

Any ideas guys I went over everything again and don't think I missed a step?

keithgulbro commented 4 years ago

@appdevsa Here's the solution:

Inside your App_Resources/Android directory modify the app.gradle file to include the following:

// Add your native dependencies here:
android {
  defaultConfig {  
    generatedDensities = []
    applicationId = "com.org.appname"
  }
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }

   // These dependencies should resolve the gradle error
  dependencies {
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
  }  
} 

Hopefully this helps! 😎