【问题标题】:InterstitialAd is not recognized as a class of Android Studio and libgdxInterstitialAd 不被识别为 Android Studio 和 libgdx 的一个类
【发布时间】:2016-03-15 14:34:46
【问题描述】:

我想在我的应用程序中添加插页式广告,我已完成以下操作:

1File -> Project Structure -> Ads:我有标志adMob

2。我的 gradle.build:

project(":android") {
    apply plugin: "android"
    apply plugin: 'com.google.gms.google-services'

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
        compile 'com.google.android.gms:play-services:8.4.0'
    }
}

3。我已经添加了来自this tutorial的代码

但我有问题...当我添加库时,不工作....:

我没有添加库来识别类...我该如何解决?

【问题讨论】:

    标签: android libgdx admob google-play-services interstitial


    【解决方案1】:

    尝试添加以下内容:

    dependencies {
        compile 'com.google.android.gms:play-services-ads:8.4.0'
    }
    

    android 项目中build.gradle 文件的底部(不是 core 项目下的那个)。

    【讨论】:

    • 您在点击 AdMob 时设置的解决方案(第 1 点)
    • @Mr.Developer 我不明白你的评论。上面的依赖是否出现在android的gradle中?
    • 我的意思是当我在我发布的第一个问题中指出时,或者添加admob ...这意味着您所说的教派成瘾...所以您已经完成了Gradle Android中的提示. :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-18
    • 2019-06-12
    • 2011-07-31
    • 2014-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多