0

I have added admob to my xml layout but im getting error like "class not found" i have checked my manifest file and my xml code many times but i dont know how to resolve it..!! Plz help!! Thanx in advance

   The following classes could not be instantiated:

This is my error in xml

    - com.google.ads.AdView (Open Class, Show Error Log)
      See the Error Log (Window > Show View) for more details.    java.lang.ClassNotFoundException: org.json.JSONException at java.net.URLClassLoader$1.run at java.net.URLClassLoader$1.run(                                                com.google.ads.AdView.a(SourceFile:352)
at com.google.ads.AdView.<init>(SourceFile:125)

My part of manifest file

        <uses-permission android:name="android.permission.INTERNET" />
         <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
         <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
          <activity 
            android:name="com.google.ads.AdActivity"
                                      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
         ></activity>

My xml where i have added admob codeenter code here

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
     android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/secondpages1"
      android:orientation="vertical" >

<Button
    android:id="@+id/firebutton"
    android:layout_width="110dp"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginTop="350dp"
    android:background="@drawable/firebutton" />

<com.google.ads.AdView
    android:id="@+id/adids"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adSize="BANNER"
    ads:adUnitId="My id"
    ads:loadAdOnCreate="true" />

      </LinearLayout>
anusha
  • 55
  • 2
  • 10

0 Answers0