gpt4 book ai didi

ionic-framework - 找不到错误 io.branch.referral.InstallListener 类崩溃 Ionic v5

转载 作者:行者123 更新时间:2023-12-04 15:34:09 36 4
gpt4 key购买 nike

我有一个 ionic 应用程序和分支 SDK 的问题,在测试环境中,一切都按预期工作,但用户在 PROD 中不断崩溃。

正如分支文档中所述,我已经在 app.component.ts 中初始化了平台就绪事件的分支:

app.component.ts
import { Component } from "@angular/core";
import { Platform } from "ionic-angular";
import { StatusBar, Splashscreen } from "ionic-native";

import { TabsPage } from "../pages/tabs/tabs";

@Component({
template: `<ion-nav [root]="rootPage"></ion-nav>`
})
export class MyApp {
rootPage = TabsPage;

constructor(platform: Platform) {
platform.ready().then(() => {
StatusBar.styleDefault();
Splashscreen.hide();
branchInit();
});

platform.resume.subscribe(() => {
branchInit();
});

// Branch initialization
const branchInit = () => {
// only on devices
if (!platform.is("cordova")) {
return;
}
const Branch = window["Branch"];
Branch.initSession().then(data => {
if (data["+clicked_branch_link"]) {
// read deep link data on click
alert("Deep Link Data: " + JSON.stringify(data));
}
});
};
}
}

错误如下:

Unable to instantiate receiver io.branch.referral.InstallListener: java.lang.ClassNotFoundException: Didn't find class "io.branch.referral.InstallListener"

这是我的 ionic 信息

    Ionic:

Ionic CLI : 5.4.15 (/Users/path/.nvm/versions/node/v9.6.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.5
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 30 other plugins)

Utility:

cordova-res : not installed
native-run (update available: 0.3.0) : 0.2.7

System:

Android SDK Tools : 26.1.1 (/Users/path/Library/Android/sdk)
NodeJS : v9.6.0 (/Users/path/.nvm/versions/node/v9.6.0/bin/node)
npm : 2.15.12
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61

最佳答案

我没有找到关于该问题的良好文档,我不确定删除该库是否会导致无法获得安装引荐来源网址,但经过一番调查后,我决定从 AndroidManifest.xml 中删除这些行

<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>

以下链接讨论了分支机构发送的通信和过时的文档,并暗示了上述解决方案。

https://github.com/BranchMetrics/unity-branch-deep-linking-attribution/issues/171

关于ionic-framework - 找不到错误 io.branch.referral.InstallListener 类崩溃 Ionic v5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60326010/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com