Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7908781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:05:42+00:00 2026-06-03T12:05:42+00:00

Hello I am new to android dev and admob. I am trying to make

  • 0

Hello I am new to android dev and admob. I am trying to make a simple test app with a button, a couple pages and admob at the bottom. Everything works fine until I try implementing admob. Here is my code:

HelloAndroid.java:

package com.manny.HelloAndroid;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    private static final int ACTIVITY_CREATE = 0;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.main);
        ImageView image = (ImageView) findViewById(R.id.test_image);
        //image.setScaleType(ImageView.ScaleType.FIT_XY);

    }
    public void onClick(View v){
        Intent i = new Intent(this, HelloPage2.class);
        startActivityForResult(i, ACTIVITY_CREATE);
    }
}

main.xml:

<?xml version="1.0" encoding="utf-8"?>
<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"
    android:orientation="vertical" >

    <ImageView 
        android:id="@+id/test_image"
        android:src="@drawable/bak_vert_480x800"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:scaleType="fitXY"
        />

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />
    <ImageButton 
        android:id="@+id/test_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/btn_arrow"
        android:layout_marginLeft="100dp"
        android:layout_marginTop="200dp"
        android:onClick="onClick"
        />
     <com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="b14be806e9ddf1f"
                         ads:adSize="BANNER"
                         ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
                         ads:loadAdOnCreate="true"/>

</RelativeLayout>

hello android Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.manny.HelloAndroid"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="7" 
        android:targetSdkVersion="13"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" 
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
        <activity
            android:name=".HelloAndroid"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".HelloPage2">
        </activity>
    <activity android:name="com.google.ads.AdActivity"
                    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|s    mallestScreenSize"/>
  </application>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>

logcat output:

05-09 13:12:00.859: D/dalvikvm(24278): GC_EXTERNAL_ALLOC freed 51K, 44% free 3054K/5379K, external 2357K/2773K, paused 94ms
05-09 13:12:00.937: D/dalvikvm(24278): GC_EXTERNAL_ALLOC freed 1K, 44% free 3053K/5379K, external 3857K/4816K, paused 31ms
05-09 13:12:01.085: D/AndroidRuntime(24278): Shutting down VM
05-09 13:12:01.085: W/dalvikvm(24278): threadid=1: thread exiting with uncaught exception (group=0x4001e560)
05-09 13:12:01.109: E/AndroidRuntime(24278): FATAL EXCEPTION: main
05-09 13:12:01.109: E/AndroidRuntime(24278): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.manny.HelloAndroid/com.manny.HelloAndroid.HelloAndroid}: android.view.InflateException: Binary XML file line #30: Error inflating class com.google.ads.AdView
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1702)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1722)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.ActivityThread.access$1500(ActivityThread.java:124)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:974)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.os.Looper.loop(Looper.java:130)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.ActivityThread.main(ActivityThread.java:3821)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at java.lang.reflect.Method.invokeNative(Native Method)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at java.lang.reflect.Method.invoke(Method.java:507)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at dalvik.system.NativeStart.main(Native Method)
05-09 13:12:01.109: E/AndroidRuntime(24278): Caused by: android.view.InflateException: Binary XML file line #30: Error inflating class com.google.ads.AdView
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:253)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.Activity.setContentView(Activity.java:1716)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at com.manny.HelloAndroid.HelloAndroid.onCreate(HelloAndroid.java:17)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1666)
05-09 13:12:01.109: E/AndroidRuntime(24278):    ... 11 more
05-09 13:12:01.109: E/AndroidRuntime(24278): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader[/data/app/com.manny.HelloAndroid-2.apk]
05-09 13:12:01.109: E/AndroidRuntime(24278):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.createView(LayoutInflater.java:471)
05-09 13:12:01.109: E/AndroidRuntime(24278):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
05-09 13:12:01.109: E/AndroidRuntime(24278):    ... 20 more
05-09 13:12:11.593: I/Process(24278): Sending signal. PID: 24278 SIG: 9

I am using GoogleAdMobAdsSdkAndroid-6.0.0. Again I am very new to this and I have tried using examples off multiple sites but the app continues to crash when it hits a page with admob in it. If someone can help me it would be much appreciated. Thank you. If more code is needed let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:05:45+00:00Added an answer on June 3, 2026 at 12:05 pm

    Have you recently updated your Android Tools to r17 or higher? If so, you need to create a libs/ folder in your project, and physically put the SDK in the project. Or, in the Java Build Path, you must Order and Export the SDK jar.

    Otherwise, the jar doesn’t get included when your apk gets compiled, and all hell breaks loose when you run AdMob code at runtime.

    NOTE: This applies to any library your project references.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am new in android. I am trying to connect my android app
Hello StackOverflow Users, I am new to android and trying to develop a game
I'm new to Android development, and I'm having trouble with a simple Hello World
Hello im new to programming, im trying to construct my first simple application, im
Hello i am new in android and i really need help with something. I
Hello I am new to Android programming and I am a bit rusty with
Hello I am new to android programming, I haven't started writing the code for
Hello i m new to android and working on Radio application i gt stuck
I'm new to Android, I've followed the hello world tutorial through and have a
Hello dear programmers, I am very new to android application development and for practice

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.