【问题标题】:Ionic email composer crash on android 11android 11上的离子电子邮件作曲家崩溃
【发布时间】:2022-01-24 22:51:58
【问题描述】:

我已经在我的项目中实现了cordova-plugin-email-composer,并且在此之前它运行良好,但是在升级到cordova-android@10.0.0 后,应用程序在触发this.emailcomposer.open(email) 时崩溃了。

只有 android 11 崩溃,而 android 8 工作正常。当我改回cordova-android@9.0.0 时,android 8 和 11 都可以正常工作。

https://github.com/katzer/cordova-plugin-email-composer/issues/350

我发现有人遇到了同样的问题。所以我想知道是一个错误还是我们需要在config.xml 上写一些东西

【问题讨论】:

  • 尝试将您的 android v 更新为 cordova-android@10.1.1。 10.0.0 有一些问题。
  • 感谢您的快速回复,我刚刚使用cordova-android@10.1.1 进行了测试,它构建成功,但在应用打开后立即崩溃。
  • 好的,我成功构建了android cordova-android@10.1.1 ,但问题仍然存在。我还尝试在config.xml 上添加权限,但在应用打开后立即崩溃。

标签: android ionic-framework ionic3 cordova-plugins


【解决方案1】:

我找到了解决 ionic email composer 崩溃问题的方法。 下面的 URL 链接是关于 android 11 更改的文档。

https://developer.android.com/about/versions/11/behavior-changes-all#share-content-uris

需要在android下的config.xml中添加如下代码

<config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
                    <uses-permission android:name="android.permission.FLAG_GRANT_READ_URI_PERMISSION" />
                </config-file>
    <config-file parent="/manifest/queries" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
                <package android:name="com.google.android.gm" />
                <package android:name="com.microsoft.office.outlook" />
                <package android:name="com.yahoo.mobile.client.android.mail" />
                <intent>
                    <action android:name="android.support.customtabs.action.CustomTabsService" />
                </intent>
            </config-file>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多