1***@qq.com
1***@qq.com
  • 发布:2024-05-04 08:07
  • 更新:2024-05-04 08:08
  • 阅读:223

【报Bug】云打包制作自定义模拟器基座,在 ios 模拟器中 通过requireNativePlugin获取不到原生插件

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: big sure 11.4

HBuilderX类型: Alpha

HBuilderX版本号: 4.14

手机系统: iOS

手机系统版本号: iOS 17

手机厂商: 模拟器

手机机型: iphone13

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

"nativePlugins" : {
"JG-JCore" : {
"JPUSH_APPKEY_IOS" : "7bda541ea2f44c8b6c2028e4",
"JPUSH_CHANNEL_IOS" : "developer-default",
"JPUSH_APPKEY_ANDROID" : "",
"JPUSH_CHANNEL_ANDROID" : "",
"plugin_info" : {
"name" : "JG-JCore",
"description" : "极光推送JCore插件",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {
"JPUSH_APPKEY_IOS" : {
"des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"key" : "JCore:APP_KEY",
"value" : "7bda541ea2f44c8b6c2028e4"
},
"JPUSH_CHANNEL_IOS" : {
"des" : "[iOS]用于统计分发渠道,不需要可填默认值developer-default",
"key" : "JCore:CHANNEL",
"value" : "developer-default"
},
"JPUSH_APPKEY_ANDROID" : {
"des" : "[Android]极光portal配置应用信息时分配的AppKey",
"key" : "JPUSH_APPKEY",
"value" : ""
},
"JPUSH_CHANNEL_ANDROID" : {
"des" : "[Android]用于统计分发渠道,不需要可填默认值developer-default",
"key" : "JPUSH_CHANNEL",
"value" : ""
}
}
}
},
"JG-JPush" : {
"JPUSH_ISPRODUCTION_IOS" : "",
"JPUSH_ADVERTISINGID_IOS" : "",
"JPUSH_DEFAULTINITJPUSH_IOS" : "",
"JPUSH_OPPO_APPKEY" : "",
"JPUSH_OPPO_APPID" : "",
"JPUSH_OPPO_APPSECRET" : "",
"JPUSH_VIVO_APPKEY" : "",
"JPUSH_VIVO_APPID" : "",
"JPUSH_MEIZU_APPKEY" : "",
"JPUSH_MEIZU_APPID" : "",
"JPUSH_XIAOMI_APPKEY" : "",
"JPUSH_XIAOMI_APPID" : "",
"JPUSH_HUAWEI_APPID" : "",
"JPUSH_HONOR_APPID" : "",
"JPUSH_GOOGLE_API_KEY" : "",
"JPUSH_GOOGLE_APP_ID" : "",
"JPUSH_GOOGLE_PROJECT_NUMBER" : "",
"JPUSH_GOOGLE_PROJECT_ID" : "",
"JPUSH_GOOGLE_STORAGE_BUCKET" : "",
"
plugin_info
" : {
"name" : "JG-JPush",
"description" : "极光推送Hbuilder插件",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {
"JPUSH_ISPRODUCTION_IOS" : {
"des" : "[iOS]是否是生产环境,是填true,不是填false或者不填",
"key" : "JPush:ISPRODUCTION",
"value" : ""
},
"JPUSH_ADVERTISINGID_IOS" : {
"des" : "[iOS]广告标识符(IDFA)如果不需要使用IDFA,可不填",
"key" : "JPush:ADVERTISINGID",
"value" : ""
},
"JPUSH_DEFAULTINITJPUSH_IOS" : {
"des" : "[iOS]是否默认初始化,是填true,不是填false或者不填",
"key" : "JPush:DEFAULTINITJPUSH",
"value" : ""
},
"JPUSH_OPPO_APPKEY" : {
"des" : "厂商OPPO-appkey,示例:OP-12345678",
"key" : "OPPO_APPKEY",
"value" : ""
},
"JPUSH_OPPO_APPID" : {
"des" : "厂商OPPO-appId,示例:OP-12345678",
"key" : "OPPO_APPID",
"value" : ""
},
"JPUSH_OPPO_APPSECRET" : {
"des" : "厂商OPPO-appSecret,示例:OP-12345678",
"key" : "OPPO_APPSECRET",
"value" : ""
},
"JPUSH_VIVO_APPKEY" : {
"des" : "厂商VIVO-appkey,示例:12345678",
"key" : "com.vivo.push.api_key",
"value" : ""
},
"JPUSH_VIVO_APPID" : {
"des" : "厂商VIVO-appId,示例:12345678",
"key" : "com.vivo.push.app_id",
"value" : ""
},
"JPUSH_MEIZU_APPKEY" : {
"des" : "厂商MEIZU-appKey,示例:MZ-12345678",
"key" : "MEIZU_APPKEY",
"value" : ""
},
"JPUSH_MEIZU_APPID" : {
"des" : "厂商MEIZU-appId,示例:MZ-12345678",
"key" : "MEIZU_APPID",
"value" : ""
},
"JPUSH_XIAOMI_APPKEY" : {
"des" : "厂商XIAOMI-appKey,示例:MI-12345678",
"key" : "XIAOMI_APPKEY",
"value" : ""
},
"JPUSH_XIAOMI_APPID" : {
"des" : "厂商XIAOMI-appId,示例:MI-12345678",
"key" : "XIAOMI_APPID",
"value" : ""
},
"JPUSH_HUAWEI_APPID" : {
"des" : "厂商HUAWEI-appId,示例:appid=12346578",
"key" : "com.huawei.hms.client.appid",
"value" : ""
},
"JPUSH_HONOR_APPID" : {
"des" : "厂商HONOR-appId,示例:12346578",
"key" : "com.hihonor.push.app_id",
"value" : ""
},
"JPUSH_GOOGLE_API_KEY" : {
"des" : "厂商google api_key,示例:g-12346578",
"key" : "google_api_key",
"value" : ""
},
"JPUSH_GOOGLE_APP_ID" : {
"des" : "厂商google mobilesdk_app_id,示例:g-12346578",
"key" : "google_app_id",
"value" : ""
},
"JPUSH_GOOGLE_PROJECT_NUMBER" : {
"des" : "厂商google project_number,示例:g-12346578",
"key" : "gcm_defaultSenderId",
"value" : ""
},
"JPUSH_GOOGLE_PROJECT_ID" : {
"des" : "厂商google project_id ,示例:g-12346578",
"key" : "project_id",
"value" : ""
},
"JPUSH_GOOGLE_STORAGE_BUCKET" : {
"des" : "厂商google storage_bucket,示例:g-12346578",
"key" : "google_storage_bucket",
"value" : ""
}
}
}
},
"Esand-LivingDetection" : {
"__plugin_info__" : {
"name" : "Android IOS 活体检测 眨眼 摇头 点头 张嘴 远近 炫彩 多动作组合",
"description" : "Android/IOS 活体检测 (眨眼,摇头,点头,张嘴,远近,炫彩),多动作组合,前后端结合,可用于实人认证,刷脸认证等场景",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=4780",
"android_package_name" : "io.youtugou",
"ios_bundle_id" : "io.youtugou",
"isCloud" : true,
"bought" : 1,
"pid" : "4780",
"parameters" : {}
}
}
}

操作步骤:

云打包的时候,控制台提示存在原生插件;
打包完的自定义基座,运行到模拟器/真机都提示当前运行的基座不包含原生插件[JG-JPush],请在manifest中配置该插件;
确认已经正确配置了插件

预期结果:

能够正常打包出来包含原生插件的自定义基座

实际结果:

打包的自定义基座不好用

bug描述:

在package.json中添加了JG-JPush 和JG-JCore,制作自定义基座后,在 app.vue 通过var jpushModule = uni.requireNativePlugin("JG-JPush");
var jpushCore = uni.requireNativePlugin("JG-JCore");无法获取到相关插件,返回 undefined;

同时控制台提示[JS Framework] 当前运行的基座不包含原生插件[JG-JPush],请在manifest中配置该插件,重新制作包括该原生插件的自定义运行基座 __WARN

2024-05-04 08:07 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

尝试了各种版本的 HBuilder 和各种原生插件,windows 和mac 真机和模拟器都尝试了,都不行

  • c***@163.com

    我也遇到这个问题,您解决了吗

    2024-05-07 19:48

  • 信仰1

    请问解决了吗,崩溃。。。

    2024-06-25 10:54

要回复问题请先登录注册