I can not solve the error with adUnitId

0

The command for the xml line is not recognized by Android Studio at all.

I'veaddedthe%import_accountinthereferencingactivityandnoticedthattheads(whichIresearched)areincludedintheproject:

Butthisalwaysappears.

xmlcode:

<?xmlversion="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:paddingBottom="10dp"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:paddingTop="10dp"
    android:background="@drawable/back_01_04"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="genesysgeneration.ruleoftree.MainActivity01">

    <TextView
        android:id="@+id/tv01"
        android:layout_width="100dp"
        android:layout_height="88dp"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/et03"
        android:background="@drawable/text_box_03_mirror" />

    <ImageView
        android:id="@+id/btnCompras"
        android:layout_width="75dp"
        android:layout_height="60dp"
        app:srcCompat="@drawable/carrinho"
        android:layout_above="@+id/space7"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <ImageView
        android:id="@+id/btnMoeda"
        android:layout_width="41dp"
        android:layout_height="60dp"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/btnCompras"
        app:srcCompat="@drawable/cifrao_02" />

    <EditText
        android:id="@+id/et01"
        android:layout_width="100dp"
        android:layout_height="88dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/btnInfo"
        android:layout_marginTop="80dp"
        android:background="@drawable/text_box_03"
        android:ems="10"
        android:inputType="number|numberDecimal" />

    <EditText
        android:id="@+id/et02"
        android:layout_width="100dp"
        android:layout_height="88dp"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/et01"
        android:background="@drawable/text_box_03_mirror"
        android:ems="10"
        android:inputType="number|numberDecimal" />

    <EditText
        android:id="@+id/et03"
        android:layout_width="100dp"
        android:layout_height="88dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/et01"
        android:layout_marginTop="54dp"
        android:background="@drawable/text_box_03"
        android:ems="10"
        android:inputType="number|numberDecimal" />

    <ImageView
        android:id="@+id/btnInfo"
        android:layout_width="29dp"
        android:layout_height="40dp"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        app:srcCompat="@drawable/info_02" />

    <ImageView
        android:id="@+id/btnChange01"
        android:layout_width="72dp"
        android:layout_height="50dp"
        android:layout_alignTop="@+id/et02"
        android:layout_centerHorizontal="true"
        app:srcCompat="@drawable/img_change" />

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        ads:adSize="BANNER"
        ads:adUnitId="@string/banner_ad_unit_id"/>

    <Space
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_above="@+id/adView"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:id="@+id/space7" />
</RelativeLayout>
    
asked by anonymous 14.08.2017 / 00:53

1 answer

0

In the file res/values/strings.xml you have to create an item with this id:

<resources>
    <string name="banner_ad_unit_id">código do unit ID do seu ad</item>
</resources>
    
14.08.2017 / 01:26