Android JAnalytics 按文档集成了,调用接口返回janalytics-visual-bury is not work

用户7309438
2022-07-09 03:40 36 1

null
就是图片上红框地方这个提示,而不是上报成功的 report success
劳烦技术大大,给看看,拜托了

使用的是mavenCentral 自动集成方式

1.项目主build.gradle
classpath 'com.android.tools.build:gradle:7.1.3'

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        mavenCentral()
    }
}

2.代码里appkey设置了

JPUSH_PKGNAME : "com.xxxxx.ayaspace",
JPUSH_APPKEY : "372138559xxxxxae57e9746c", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.

3.清单文件权限和appkey也设置了

<meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" />
<meta-data android:name="JPUSH_APPKEY" android:value="3721385xxxxxaae57e9746c" />

4.Application中的初始化和页面中的使用

JAnalyticsInterface.setDebugMode(true); // 设置开启极光统计(JAnalytics)的日志,发布时请关闭日志
JAnalyticsInterface.init(this);
JAnalyticsInterface.initCrashHandler(this);
JAnalyticsInterface.setChannel(this, null);
CountEvent cEvent = new CountEvent("mId");
cEvent.addKeyValue("key1","value1").addKeyValue("key2","value2");
JAnalyticsInterface.onEvent(getActivity(),cEvent);

CalculateEvent cEvent2 = new CalculateEvent("mId2",3.33);
cEvent.addKeyValue("key11","value11").addKeyValue("key22","value22");
JAnalyticsInterface.onEvent(getActivity(),cEvent2);

1个回答

热门排序
gptbots-widget