gpt4 book ai didi

Error: googleMobileAds/error-code-network-error The ad request was unsuccessful due to network connectivity(错误:googleMobileAds/Error-Code-Network-Error由于网络连接,广告请求未成功)

转载 作者:bug小助手 更新时间:2023-10-25 11:53:51 33 4
gpt4 key购买 nike



I've developed an app using React Native and Expo and wanted to add a banner ad to the end of it. When I run the app on a development build on an Android emulator the rest of the app runs without the app although there is space open where it should be and eventually I get this error [Error: [googleMobileAds/error-code-network-error] The ad request was unsuccessful due to network connectivity.]

我已经开发了一款使用Reaction Native和世博会的应用程序,并想在它的末尾添加一个横幅广告。当我在Android模拟器上的开发版本上运行应用程序时,应用程序的其余部分在没有应用程序的情况下运行,尽管应该有空间打开,但最终我收到了这个错误[Error:[googleMobileAds/Error-Code-Network-Error]广告请求因网络连接而失败。]


app.json:

{
"expo": {
...
}
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxx,
"ios_app_id": "ca-app-pub-xxx"
}
}

  App.js:

import {
BannerAd,
BannerAdSize,
TestIds,
} from "react-native-google-mobile-ads";

const adUnitId = __DEV__
? TestIds.BANNER
: "ca-app-pub-adunitid";

return(
<View>
...
<BannerAd
unitId={TestIds.BANNER}
size={BannerAdSize.BANNER}
requestOptions={{
requestNonPersonalizedAdsOnly: true,
}}
onAdFailedToLoad={(errorCode) => console.log(errorCode)}
/>
</View>
)

These are the commands I ran to get the app up and running:

以下是我为启动和运行该应用程序而运行的命令:


eas build --profile development --platform android

EAS构建--配置文件开发--平台Android


npx expo start --dev-client

NPX EXPO启动--开发-客户端


更多回答
优秀答案推荐
更多回答

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com