NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
102 stars 50 forks source link

NoSuchMethodError being called on NotificationCompat$Builder #162

Closed davecoffin closed 6 years ago

davecoffin commented 6 years ago

Heres the full error:

java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/Context;Ljava/lang/String;)V in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/appid/base.apk)
at
net.gotev.uploadservice.UploadTask.createNotification(UploadTask.java:453)

{N} cli, core modules and android runtime are all up to date.

davecoffin commented 6 years ago

Any help here? I still havent figured this out

davecoffin commented 6 years ago

Ok, thanks to dick smith I fixed this by using these settings in my app.gradle:

dependencies {
    configurations.all {
        exclude group: 'commons-logging', module: 'commons-logging'
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.google.android.gms' || requested.group == 'com.google.firebase') {
                details.useVersion '12.0.1'
            } else if (requested.group == 'com.android.support' && requested.name != 'multidex') {
                // com.android.support major version should match buildToolsVersion
                details.useVersion '27.+'
            }
        }
    }
}

project.ext {
    googlePlayServicesVersion = "12.0.1"
    supportVersion = "27.+"
}

android {  
  compileSdkVersion 27
  buildToolsVersion "27.0.3"
  defaultConfig {  
    generatedDensities = []    
    applicationId = "APPID"  
    minSdkVersion 21
    targetSdkVersion 27
    ndk {
      abiFilters "arm64-v8a", "armeabi-v7a", "x86"
    }
  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }    
}