跳到主要内容

极光切公有云之鑫联盟Android

· 阅读需 2 分钟
Quany
软件工程师

极光切公有云接入鑫联盟出现的问题

运行环境:

  • "react-native": "0.59.10",
  • "jcore-react-native": "2.2.3",
  • "jpush-react-native": "3.1.2",

Android 环境

构建时出现的问题

  1. 不支持namespace;

报错信息:

危险

Build file '/Volumes/Samsung/sxf/rn/uxlm-app/node_modules/jpush-react-native/android/build.gradle' line: 10

A problem occurred evaluating project ':jpush-react-native'.

Could not find method namespace() for arguments [cn.jiguang.plugins.push] on extension 'android' of type com.android.build.gradle.LibraryExtension.

  • Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating project ':jpush-react-native'.

处理办法:注释掉

运行 App 时出现的问题

  1. packageName 获取不到;
危险

Caused by: java.lang.RuntimeException: Cannot read packageName from /Volumes/Samsung/sxf/rn/uxlm-app/node_modules/jpush-react-native/android/src/main/AndroidManifest.xml

定义package="com.suixingpay.tssapp",会报如下错误:

危险

Type com.suixingpay.tssapp.BuildConfig is defined multiple times: /Volumes/Samsung/sxf/rn/uxlm-app/android/app/build/intermediates/mixed_scope_dex_archive/devDebug/out/com/suixingpay/tssapp/BuildConfig.dex, /Volumes/Samsung/sxf/rn/uxlm-app/android/app/build/intermediates/mixed_scope_dex_archive/devDebug/out/94014fa2f8dbb5fffcb8d061b5a179ca085642193f39b3ca55a3ec960366a279_1.jar:classes.dex**

  1. js调用报错:
危险

TypeError: _jpushReactNative.default.init is not a function

  1. JCore 错误
危险

2024-11-29 18:00:06.100 9230-22686 JIGUANG-JCore com.suixingpay.tssapp E [CheckManifestHelper] [key-step]errorcode:10001,metadata: JCore appKey - not defined in manifest

微信公众号