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 6385497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:54:25+00:00 2026-05-25T02:54:25+00:00

I’m trying to incorporate AdMob into my Android application. I’m using IntelliJ IDEA for

  • 0

I’m trying to incorporate AdMob into my Android application. I’m using IntelliJ IDEA for development and I cannot seem to set my project up properly. At this point I’ve done the following:

  1. Did all the preliminary steps necessary to download the AdMob SDK.
  2. Followed the directions here, trying to augment them for IntelliJ IDEA. I’ve added a Single-Entry Module Library dependency to the AdMob SDK to my project.

It looks like the IDE has no problem recognizing the classes from the SDK if I try to use them in code. However, it fails to resolve them in XML. I have the following two errors:

  1. Cannot resolve symbol ‘AdActivity’ when I set up the ad activity in AndroidManifest.xml the instructions call for.
  2. Element com.google.ads.AdView is not allowed here when I try to add an ad view to a layout in the manner documented here.

Thank you very much in advance for your help. I hope I’ve been clear.

EDIT

A clarification based on Cristian’s answer. It’s true that the first error seems to not matter. However, the second error causes the project build to break with the following message:

…/res/layout/main.xml:7: error: Error parsing XML: unbound prefix

The XML in question is the following layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

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

    <ImageView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_alignParentTop="true"
               android:layout_marginLeft="123dp"
               android:src="@drawable/logo"/>

    <ImageView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_alignParentBottom="true"
               android:layout_alignParentRight="true"
               android:src="@drawable/cart"/>

    <Button android:id="@+id/new_shopping_list"
            android:layout_width="223dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="90dp"
            android:text="@string/new_shopping_list_btn"/>

    <Button android:id="@+id/view_all_shopping_lists"
            android:layout_width="223dp"
            android:layout_height="wrap_content"
            android:layout_below="@id/new_shopping_list"
            android:text="@string/saved_shopping_lists_btn"/>

    <ImageView android:id="@+id/copyright_notice"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_alignParentBottom="true"
               android:layout_alignParentRight="true"
               android:layout_marginBottom="7dp"
               android:layout_marginRight="5dp"
               android:src="@drawable/copyright"/>

    <ImageView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_above="@id/copyright_notice"
               android:layout_alignParentRight="true"
               android:layout_marginBottom="5dp"
               android:layout_marginRight="4dp"
               android:src="@drawable/techsmart_logo"/>

    <ImageButton android:id="@+id/user_guide"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentBottom="true"
                 android:layout_alignParentLeft="true"
                 android:layout_marginBottom="7dp"
                 android:layout_marginLeft="5dp"
                 android:src="@drawable/user_guide"/>

</RelativeLayout>
  • 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-05-25T02:54:26+00:00Added an answer on May 25, 2026 at 2:54 am

    Do not worry about those errors. AdMob library is obfuscated, thus IntelliJ cannot read the correct names of the classes. However, your application will compile and run fine. This is how one of my projects looks like, and they work fine:

    enter image description here

    As you can see, there are other libraries like Pontiflex or AirPush that has the same problem.

    With regards to your second problem, it seems you forget to add the XML NameSpace. This answer says that you must add this one:

    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.