【问题标题】:java.lang.IllegalStateException: Couldn't find implementation for Permissions interfacejava.lang.IllegalStateException:找不到权限接口的实现
【发布时间】:2021-09-15 00:11:23
【问题描述】:

我的 expo react-native 应用程序在开发模式下(Expo Go)在本地运行良好。但是从 Google Play 商店下载和安装时,它在生产中无情地崩溃。使用logcat,报错信息是:

java.lang.IllegalStateException: Couldn't find implementation for Permissions interface.

唯一的权限相关代码是expo-notifications的通知权限请求。

import * as Notifications from 'expo-notifications';
...
await ExpoNotifications.getPermissionsAsync();
...
await ExpoNotifications.requestPermissionsAsync();

任何帮助将不胜感激

感谢您帮助解决此问题。

【问题讨论】:

  • 我遇到了同样的问题。我通过删除 expo-permission 解决了这个问题。

标签: android react-native google-play expo expo-notifications


【解决方案1】:

遇到了类似的问题。

似乎expo-permissions弃用。参考here

解决我的问题的方法是从项目中删除 expo-permission 包。

cd ProjectName

expo uninstall expo-permissions

npm uninstall expo-permissions

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,并在更新博览会通知后设法让它工作:

    npm install expo-notifications@0.12.2
    

    其他人提到他们必须更新其他与 expo 相关的软件包,因为 expo-permissions 已被弃用,就像上面提到的 @sanjeev。

    【讨论】:

      猜你喜欢
      • 2018-03-14
      • 1970-01-01
      • 2013-12-08
      • 2022-01-11
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多