java.lang.NoClassDefFoundError:com.google.android.gms.location.LocationClient使用Vungle sdk时出错

时间:2016-09-21 08:05:10

标签: android google-maps android-studio google-cloud-messaging vungle-ads

我的应用级别gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.mss.jackpotslots"
        minSdkVersion 15
        targetSdkVersion 23
        multiDexEnabled true
    }
    //====================Add below two line=============
    dexOptions {
        javaMaxHeapSize "4g" //specify the heap size for the dex process
        preDexLibraries = false //delete the already predexed libraries
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:23.4.0'
    compile files('libs/dagger-1.2.2.jar')
    compile files('libs/javax.inject-1.jar')
       // compile files('libs/libGoogleAnalyticsServices.jar')
    compile 'com.google.android.gms:play-services-analytics:9.0.0'
    compile files('libs/vungle-publisher-3.2.0.jar')
    compile 'com.google.android.gms:play-services-ads:9.0.0'
    compile 'com.google.android.gms:play-services:9.0.0'
    compile 'org.apache.httpcomponents:httpclient:4.5'
    compile 'com.scottyab:aescrypt:0.0.1'
    compile project(':wheelLib')
    compile 'com.google.android.gms:play-services-maps:9.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-games:9.0.0'
    compile 'com.google.android.gms:play-services-location:9.0.0'
}
apply plugin: 'com.google.gms.google-services'

我的项目级别Gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.google.gms:google-services:3.0.0'
      //  classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.9.+'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

我的LogCat错误OutPut

 E/VungleAsync: java.lang.NoClassDefFoundError: com.google.android.gms.location.LocationClient
                                                                       at com.vungle.publisher.location.GooglePlayServicesDetailedLocationProvider.a(vungle:30)
                                                                       at com.vungle.publisher.location.AndroidLocation.b(vungle:35)
                                                                       at com.vungle.publisher.protocol.message.RequestAd$Demographic$Location$Factory.b(vungle:180)
                                                                       at com.vungle.publisher.protocol.message.RequestAd$Demographic$Factory.b(vungle:130)
                                                                       at com.vungle.publisher.protocol.message.RequestAd$a.b(vungle:84)
                                                                       at com.vungle.publisher.protocol.message.RequestLocalAd$Factory.c(vungle:71)
                                                                       at com.vungle.publisher.protocol.RequestLocalAdHttpRequest$Factory.d(vungle:68)
                                                                       at com.vungle.publisher.inject.ConfigurablePublisherModule.a(vungle:325)
                                                                       at com.vungle.publisher.inject.ConfigurablePublisherModule$$ModuleAdapter$ProvideRequestLocalAdHttpTransactionProvidesAdapter.get(vungle:849)
                                                                       at com.vungle.publisher.inject.ConfigurablePublisherModule$$ModuleAdapter$ProvideRequestLocalAdHttpTransactionProvidesAdapter.get(vungle:810)
                                                                       at com.vungle.publisher.protocol.ProtocolHttpGateway$2.run(vungle:127)
                                                                       at com.vungle.publisher.async.ScheduledPriorityExecutor$a$a.run(vungle:233)
                                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                       at java.lang.Thread.run(Thread.java:841)
  

我正在运行我的应用程序时遇到此错误。我不知道为什么会这样   正在显示此问题,如果有人这样做之前请求帮助   提前谢谢

4 个答案:

答案 0 :(得分:0)

您需要更新Google Play Service SDK,然后使用更新的库。

答案 1 :(得分:0)

新版本(自{Google发布FusedLocationProviderApi)以来com.google.android.gms.location版本不包含名为LocationClient的类。相反,现在我们使用集中式API服务实现 - GoogleApiClient类。有关如何相应更新逻辑的信息,请参阅this answer

有关最新com.google.android.gms.location包中的界面和类列表,请访问以下链接:https://developers.google.com/android/reference/com/google/android/gms/location/package-summary

答案 2 :(得分:0)

 E/VungleAsync: java.lang.NoClassDefFoundError: com.google.android.gms.location.LocationClient
                                                                       at com.vungle.publisher.location.GooglePlayServicesDetailedLocationProvider.a(vungle:30)
                                                                       at com.vungle.publisher.location.AndroidLocation.b(vungle:35)
                                                                       at com.vungle.publisher.protocol.message.RequestAd$Demographic$Location$Factory.b(vungle:180)
                                                                       at com.vungle.publisher.protocol.message.RequestAd$Demographic$Factory.b(vungle:130)
                                                                       at com.vungle.publisher.protocol.message.RequestAd$a.b(vungle:84)
                                                                       at com.vungle.publisher.protocol.message.RequestLocalAd$Factory.c(vungle:71)
                                                                       at com.vungle.publisher.protocol.RequestLocalAdHttpRequest$Factory.d(vungle:68)
                                                                       at com.vungle.publisher.inject.ConfigurablePublisherModule.a(vungle:325)
                                                                       at com.vungle.publisher.inject.ConfigurablePublisherModule$$ModuleAdapter$ProvideRequestLocalAdHttpTransactionProvidesAdapter.get(vungle:849)
                                                                       at com.vungle.publisher.inject.ConfigurablePublisherModule$$ModuleAdapter$ProvideRequestLocalAdHttpTransactionProvidesAdapter.get(vungle:810)
                                                                       at com.vungle.publisher.protocol.ProtocolHttpGateway$2.run(vungle:127)
                                                                       at com.vungle.publisher.async.ScheduledPriorityExecutor$a$a.run(vungle:233)
                                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                       at java.lang.Thread.run(Thread.java:841)

答案 3 :(得分:0)

很抱歉迟到的回复。 我是来自Vungle的Aki。

您可以尝试使用我们最新的Android SDK吗? https://v.vungle.com/dashboard/api/1/sdk/android

如果您仍然发现问题,请联系tech-support@vungle.com。

谢谢, -aki