2014-06-20 2 views
0

이 질문은 전에 질문했을 수도 있지만 그 대답을 사용하여 문제를 해결할 수는 없습니다.Android Ads 누락 된 XML 속성

내 문제는 이클립스를 사용하여 레이아웃에 내 AdView를 추가 할 때 메시지가 나타납니다. 필수 XML 속성 인 "adSize"가 누락되었습니다.

이 나의 현재 활동의 XML입니다 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/content" 
xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:gravity="center" 
android:orientation="vertical" > 

<android.support.v4.view.ViewPager 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/pager" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="0.9" 
    android:background="@drawable/background"> 

</android.support.v4.view.ViewPager> 

<com.google.android.gms.ads.AdView 
    xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads" 
    android:id="@+id/adView" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_weight="0.1" 
    ads:adSize="BANNER" 
    ads:adUnitId="mycodehidden"> 

</com.google.android.gms.ads.AdView> 

이 또한 내가이 프로그램을 실행할 때 표시에는 광고가 없다.

답변

0

기존 및 새로운 admob apis를 모두 결합했습니다. 잘못된 것입니다. 그런 다음 매니페스트의 응용 프로그램에서
xmlns:ads="http://schemas.android.com/apk/res-auto

:

에서 : xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads"

에 구글 플레이 서비스 라이브러리를 통해 몹을 사용

는 광고 XML 네임 스페이스를 변경 태그 :

<activity android:name="com.google.android.gms.ads.AdActivity" 
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> 


<meta-data android:name="com.google.android.gms.version" 
       android:value="@integer/google_play_services_version"/> 

잊지 마세요 권한 :

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 
관련 문제