Java 获得';无效的应用程序ID';尝试在Android应用程序中实现AdMob时出错
我已经跟踪google admob vidoes 3天了,但是我在logCat中发现了一个运行时错误: Logcat 进程:com.exafmplle.android.happybirthdayyyy,PID:19319 java.lang.RuntimeException:无法获取提供程序 com.google.android.gms.ads.mobileadsini提供程序: java.lang.IllegalStateException: 无效的应用程序ID。请按照此处的说明操作:到* *找到你的应用程序ID activitymainJava 获得';无效的应用程序ID';尝试在Android应用程序中实现AdMob时出错,java,android,admob,Java,Android,Admob,我已经跟踪google admob vidoes 3天了,但是我在logCat中发现了一个运行时错误: Logcat 进程:com.exafmplle.android.happybirthdayyyy,PID:19319 java.lang.RuntimeException:无法获取提供程序 com.google.android.gms.ads.mobileadsini提供程序: java.lang.IllegalStateException: 无效的应用程序ID。请按照此处的说明操作:到* *
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerLayout"
android:background="@drawable/january_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.exafmpflle.android.xxxxxxx.MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/idbuttonfirst"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignTop="@+id/idbuttonsecond"
android:layout_marginStart="79dp"
android:background="@drawable/ic_iconaphoto"
android:src="?attr/selectableItemBackground" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
app:adSize="BANNER"
app:adUnitId="ca-app-pub-52924220005747xx/xxxxxxxx" />
</RelativeLayout>
<android.support.design.widget.NavigationView
android:layout_gravity="start"
android:id="@+id/nav_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:menu="@menu/navigation_menu" />
xmlns:android=”http://schemas.android.com/apk/res/android"
xmlns:tools=”http://schemas.android.com/tools"
xmlns:app=”http://schemas.android.com/apk/res-auto"
android:id=“@+id/drawerLayout”
android:background=“@drawable/janu\u main”
android:layout\u width=“匹配父项”
android:layout\u height=“match\u parent”
工具:context=“com.exafmplle.android.xxxxxxx.MainActivity”>
在您的清单文件中
将其更改为:
拆下开口方形支架。
为了更好地实践,请在string.xml
文件中定义此类ID,而不是直接在清单文件中使用
将其更改为:
拆下开口方形支架。
为了更好地练习,请在string.xml
文件中定义此类ID,而不是直接使用。如此有用的注释@Sam。我一次又一次地遵循该说明。。。无效的应用程序ID。请按照以下说明操作:**查找你的应用程序ID。我已经阅读了谷歌帮助,我知道:(@Sam.in-app id android value,manifest文件中的方括号是什么?@Sam.我一次又一次地遵循该说明…无效的应用程序id。遵循以下说明:**查找你的应用程序id。我已经阅读了谷歌帮助,我知道:(@Sam.manifest文件中打开的方括号是什么,应用程序内id的android值是多少?
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.exafmpflle.android.xxxxxxx"
android:installLocation="auto">
<!-- Include required 2 permissions for Google Mobile Ads to run-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:name="android.permission.CALL_PHONE"
android:required="false" />
<uses-feature android:name="android.permission.READ_PHONE_STATE"
android:required="false" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:hardwareAccelerated="false"
android:installLocation="auto"
android:icon="@mipmap/ic_launcher_birthdaycake"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- Sample AdMob App ID: ca-app-pub-5292422000574799~xxxxxxxx -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="[ca-app-pub-5292422000574799~xxxxxxxxxx"/>
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--Include the AdActivity configChanges and theme. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:noHistory="false"/>
<activity
android:label="@string/about"
android:name=".About"
android:screenOrientation="portrait"
android:noHistory="false" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
<!-- [START firebase_service] -->
<service
android:name=".FirebaseMessagingService" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorPrimary" />
<!-- FirebaseMessagingService performs security checks at runtime,
no need for explicit permissions despite exported="true" -->
<service
android:name="com.google.firebase.messaging.FirebaseMessagingService"
android:exported="true" >
<intent-filter
android:priority="-500" >
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true"
android:exported="false" >
</receiver>
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false" />
<service
android:name="com.google.android.gms.measurement.AppMeasurementJobService"
android:enabled="true"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.exafmpflle.android.happybirthdayyyy" />
</intent-filter>
</receiver>
<!-- FirebaseInstanceIdService performs security checks at runtime,
no need for explicit permissions despite exported="true" -->
<service
android:name="com.google.firebase.iid.FirebaseInstanceIdService"
android:exported="true" >
<intent-filter android:priority="-500" >
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="com.exafmpflle.xxxxxx.xxxxxxxxx.firebaseinitprovider"
android:exported="false"
android:initOrder="100" />
</application>