React native -Google移动的广告的错误

lyfkaqu1  于 2023-04-12  发布在  React
关注(0)|答案(1)|浏览(151)

我正在使用React Native构建一个移动的应用程序

"react-native": "^0.71.1",
"react-native-google-mobile-ads": "^9.1.1"

如果没有google-mobile-ads,app可以正常工作。但是使用这个模块,我得到这个错误

023-02-07 23:05:06.067 xcodebuild[92292:1835009] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x7fa23ae8f960: name:Docs.docc path:group:Docs.docc> Failed to load container at path: /Users/sangnlee/Library/Developer/Xcode/DerivedData/aaa-csqwegbowuhmbrehpztorwqemvkb/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
** BUILD FAILED **

The following build commands failed:
        Ld /Users/aaa/Library/Developer/Xcode/DerivedData/aaa-csqwegbowuhmbrehpztorwqemvkb/Build/Products/Debug-iphonesimulator/aaa.app/aaa normal (in target 'aaa' from project 'aaa')
(1 failure)

有人知道怎么解决这个问题吗?

qhhrdooz

qhhrdooz1#

请按照以下步骤操作:

1- You have to use the original ad id in the app.json file
2- If you are using expo then you have to include this

 "react-native-google-mobile-ads": {
    "android_app_id": "xxxx",
    "ios_app_id": "xxxxx"
  }

世博会后
如果这不起作用,请在这里发表评论。我会尽快回复。

相关问题