类型不匹配:推断类型为RewardItem?但预期是RewardItem

huangapple go评论60阅读模式
英文:

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>



huangapple
  • 本文由 发表于 2023年2月6日 20:44:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/75361471.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定