MrE*_*r13 1 android admob android-studio
所以我在Android Studio v 0.3.6上,我遇到了Google Play服务的问题.我已经在我的项目中使用Admob jar但我必须更新它,所以我尝试通过说明添加它们.我的项目编译正常但是当我尝试运行一个活动时,我收到以下错误:
Didn't find class "com.google.ads.AdView" on path: /data/app/com.mre. example-1. apk
Run Code Online (Sandbox Code Playgroud)
请参阅此处的完整错误输出.我的build.gradle的相关部分:
apply plugin: 'android'
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile 'com.google.android.gms:play-services:4.0.30'
//compile project(':libraries:google-play-services_lib')
//compile files('libs/google-play-services.jar')
...
}
android {
compileSdkVersion 18
buildToolsVersion '18.0.1'
defaultConfig {
minSdkVersion 8
targetSdkVersion 18
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的清单
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"ex">
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
<meta-data
android:name="com.google.android.gms.appstate.APP_ID"
android:value="@string/app_id" />
...
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
Run Code Online (Sandbox Code Playgroud)
这是布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
...
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="50dp"
ads:adSize="BANNER"
ads:adUnitId="@string/ad_unit_id"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
android:gravity="center" />
...
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
在过去的两天里,我尝试了将GPS库添加到我的项目中的每一种变化,只需要将jar添加到无.起初我从我的/ libs中删除了jar,并将所需的行添加到我的build.gradle中,但这也没有用.我提前感谢您提供的任何帮助.
| 归档时间: |
|
| 查看次数: |
8999 次 |
| 最近记录: |