1

我正在尝试将 Appodeal 公司(一家广告中介公司)的库实现到我在 Android Studio 中的应用程序中,这样我就可以运行他们的广告并通过我的应用程序获利。我按照他们的指示:首先,将必要的库放在 libs 文件夹中其次,在 gradle 文件中添加必要的依赖项:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
    applicationId 'com.languagematerial.lmmovies'
    minSdkVersion 23
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
    useLibrary 'org.apache.http.legacy'
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}

packagingOptions {

    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
}

}

repositories{
jcenter()
flatDir {
    dirs 'libs'
}

}

dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support:recyclerview-v7:27.0.0'
compile 'com.android.support:support-media-compat:27.0.0'
compile 'com.android.support:support-v4:27.0.0'
android {
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
}
compile 'com.android.support:multidex:1.0.3'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'org.apmem.tools:layouts:1.10@aar'
compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
compile 'com.nononsenseapps:filepicker:4.1.0'
compile 'org.apache.commons:commons-io:1.3.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:gridlayout-v7:27.0.0'
compile files('libs/icu4j-61_1.jar')
compile 'android.arch.lifecycle:extensions:1.0.0-alpha4'
compile 'android.arch.persistence.room:runtime:1.0.0-alpha4'
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha4"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha4"

compile 'pub.devrel:easypermissions:0.3.0'
compile('com.google.api-client:google-api-client-android:1.23.0') {
    exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-youtube:v3-rev186-1.23.0') {
    exclude group: 'org.apache.httpcomponents'
}
compile 'com.google.android.gms:play-services-auth:10.2.1'

compile 'com.google.android.ads.consent:consent-library:1.0.3'

compile 'com.google.android.gms:play-services-base:10.2.1'

compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
//for Inmobi
compile name: 'adcolony-sdk-3.2.1', ext: 'aar'
compile name: 'mmedia-6.4.0', ext: 'aar'
compile name: 'mobvista_alphab', ext: 'aar'
compile name: 'mobvista_appwall', ext: 'aar'
compile name: 'mobvista_appwallext', ext: 'aar'
compile name: 'mobvista_common', ext: 'aar'
compile name: 'mobvista_interstitial', ext: 'aar'
compile name: 'mobvista_mvdownloads', ext: 'aar'
compile name: 'mobvista_mvjscommon', ext: 'aar'
compile name: 'mobvista_mvnative', ext: 'aar'
compile name: 'mobvista_nativeex', ext: 'aar'
compile name: 'mobvista_offerwall', ext: 'aar'
compile name: 'mobvista_playercommon', ext: 'aar'
compile name: 'mobvista_reward', ext: 'aar'
compile name: 'mobvista_videocommon', ext: 'aar'
compile name: 'mobvista_videofeeds', ext: 'aar'

}

这同步成功。当我将包添加到我的清单文件时,就会出现问题。如图所示,它们中的大多数都带有红色消息:未解析的类,好像引用的库不在 lib 文件夹中,但显然它们在那里。那么这个问题是从哪里来的呢?甚至 Appodeal 的技术支持人员也无法帮助我。你有什么线索吗?

在此处输入图像描述

4

0 回答 0