我不知道为什么我的应用不显示广告?

I don't know why my app doesn't show ads?

我创建了一个应用程序,我添加了 react-native-admob 并将其链接 我更改了 /node_modules/react-native-admob/android/build.gradle 文件:

编译'com.google.android.gms:play-services-ads:+'

编译'com.google.android.gms:play-services-ads:15.0.0'

然后使用“./gradlew clean && ./gradlew assembleRelease”构建 apk,但是当我在我的 phone 中安装应用程序时它没有显示广告。 这是我的代码

 import {
    AdMobBanner,
    AdMobInterstitial,
    PublisherBanner,
    AdMobRewarded,
  } from 'react-native-admob';

.....

<View>
<AdMobBanner
    adSize="fullBanner"
    adUnitID="ca-app-pub-2174326550695558/6129769558"
     onAdFailedToLoad={error => console.error(error)}
 />
 </View>

这是我的 AndroidManifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.brawlcalculator">

 <uses-permission android:name="android.permission.INTERNET" />

  <application
    android:name=".MainApplication"
    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:allowBackup="false"
    android:theme="@style/AppTheme">
    <activity
      android:name=".MainActivity"
      android:label="@string/app_name"
      android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
      android:windowSoftInputMode="adjustResize">
      <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity 
        android:name="com.facebook.react.devsupport.DevSettingsActivity" />
  </application>

</manifest>

在您的 AndroidManifest.xml 文件中:

将您的 admob 应用程序 ID 添加到应用程序标签内的元标签中

<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:allowBackup="false"
  android:theme="@style/AppTheme"
> // Look at this ... after the closing tag
  <meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-2174326550695558~2753605675"
  />
</application>