英文:
Type mismatch: inferred type is RewardItem? but RewardItem was expected
问题
e: /node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAdHelper.kt: (76, 33): 类型不匹配:推断类型为 RewardItem?,但预期是 RewardItem
有人知道如何解决这个问题吗?
<details>
<summary>英文:</summary>
e: /node_modules/react-native-google-mobile-ads/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAdHelper.kt: (76, 33): Type mismatch: inferred type is RewardItem? but RewardItem was expected
someone know how fix this issue?
</details>
# 答案1
**得分**: 1
你的变量可以是 `undefined`。你可以在 `RewardItem?` 末尾的 `?` 看到这一点。在调用 Admob 方法之前,你可能必须处理这种情况。
<details>
<summary>英文:</summary>
Your variable can be `undefined`. You can see that with the `?` at the end of `RewardItem?`. You must probably deal with the case before calling admob method.
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论