【发布时间】:2020-01-16 18:21:32
【问题描述】:
React-Native-Firebase V6 文档没有指定在哪里创建文件 firebase.json。
"dependencies": {
"@react-native-firebase/admob": "^0.4.1",
"@react-native-firebase/app": "^0.1.2",
"@react-native-firebase/auth": "^0.1.2",
"@react-native-firebase/firestore": "^0.1.2",
"matter-js": "^0.14.2",
"react": "16.8.6",
"react-native": "0.60.3",
"react-native-elements": "^1.1.0",
"react-native-game-engine": "^0.11.5",
"react-native-gesture-handler": "^1.3.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-progress": "^3.6.0",
"react-native-radial-gradient": "^1.0.5",
"react-native-share": "^2.0.0",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^3.11.1"
},
控制台出现以下错误:
-
地点:
构建文件 'D:\Jesus\IFEEP AT\StoreClicker\StoreSkinClicker\node_modules@react-native-firebase\admob\android\build.gradle' 行:44
-
出了什么问题:
评估项目“:@react-native-firebase_admob”时出现问题。 没有方法签名:java.util.LinkedHashMap.getStringValue() 适用于参数类型:(String, String) 值:[admob_app_id, ]
【问题讨论】:
-
firebase.json文件由 Firebase CLI 使用。我没有立即在您收到的消息中看到任何表明需要firebase.json的内容。你确定你不是指google-services.json? -
在 react-native-firebase 文档中它说
Add the ID to your root level firebase.json file under the react-native object: { "react-native": { "admob_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx" } } -
有趣。我猜他们在构建期间使用该文件。那就是说它需要在根目录中,所以你把它放在你项目的根目录中了吗?
-
是的,我把它放在我项目的根目录下。在我的 package.json 所在的同一个地方
标签: javascript firebase react-native