Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android应用程序上集成Admob时出错(应用程序崩溃)_Android_Android Gradle Plugin_Admob - Fatal编程技术网

在android应用程序上集成Admob时出错(应用程序崩溃)

在android应用程序上集成Admob时出错(应用程序崩溃),android,android-gradle-plugin,admob,Android,Android Gradle Plugin,Admob,当我试图在我的设备上启动应用程序时,应用程序崩溃,我出现以下错误: android.view.InflateException: Binary XML file line #9: Error inflating class com.google.ads.AdView 我已经尝试了stackoverflow上提出的解决方案,但它不能解决这个错误 文件build.gradle(包括依赖项) com.google.ads.AdView是将移动ads SDK与google Play服务集成之前使用的软

当我试图在我的设备上启动应用程序时,应用程序崩溃,我出现以下错误:

android.view.InflateException: Binary XML file line #9: Error inflating class com.google.ads.AdView
我已经尝试了stackoverflow上提出的解决方案,但它不能解决这个错误

文件build.gradle(包括依赖项)


com.google.ads.AdView
是将移动ads SDK与google Play服务集成之前使用的软件包名称。尝试在布局中使用当前的一个

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:16'
    buildToolsVersion '21.1.2'

    defaultConfig {
        applicationId "com.recipes.app"
        minSdkVersion 9
        targetSdkVersion 9
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_5
            targetCompatibility JavaVersion.VERSION_1_5
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-ads:8.3.0'
}