我就是小伟哥
我就是小伟哥
  • 发布:2024-10-22 19:49
  • 更新:2025-01-23 09:54
  • 阅读:217

安卓集成unisdk4.2.9版本之后 调用openUniMP完全无反应 ,具体的代码如下

分类:uni小程序sdk

wgt结构

引入的lib如下

打开的代码如下

{  

                try {  
                    MenuActionSheetItem item = new MenuActionSheetItem("关于", "about");  
                    List<MenuActionSheetItem> sheetItems = new ArrayList<>();  
                    sheetItems.add(item);  
                    DCSDKInitConfig uniConfig = new DCSDKInitConfig.Builder()  
                            .setCapsule(true)  
                            .setMenuDefFontSize("16px")  
                            .setMenuDefFontColor("#ff00ff")  
                            .setMenuDefFontWeight("normal")  
                            .setMenuActionSheetItems(sheetItems)  
                            .setEnableBackground(false)//开启后台运行  
                            .build();  
                    DCUniMPSDK.getInstance().initialize(mContext, uniConfig, new IDCUniMPPreInitCallback() {  
                        @Override  
                        public void onInitFinished(boolean b) {  
                            log("onInitFinished"+b);  
                        }  
                    });  

                }  
                catch (Exception e){  
                    log("wfwooooooo");  
                    log("wfwinit"+e);  
                }  

                try {  
                    UniMPOpenConfiguration uniMPOpenConfiguration = new UniMPOpenConfiguration();  
                    uniMPOpenConfiguration.splashClass = MySplashView.class;  
                    uniMPOpenConfiguration.extraData.put("darkmode","light");  
                    log("wfw112");  
                    log(mContext);  
//                    SoftReference<IUniMP> mallMP = new SoftReference<>(DCUniMPSDK.getInstance().openUniMP(mContext, "__UNI__F743940", uniMPOpenConfiguration));  

                    IUniMP uniMP = DCUniMPSDK.getInstance().openUniMP(mContext,"__UNI__131D0E4", uniMPOpenConfiguration);  

                } catch (Exception e) {  
                    e.printStackTrace();  
                }  

                JSONObject jsonObject = DCUniMPSDK.getInstance().getAppVersionInfo("__UNI__131D0E4");  
                if(jsonObject != null) {  
                    log("__UNI__04E3A11版本信息为"+jsonObject.toString());  
                }  

            }

点击之后 无任何报错 也打不开小程序

D/Noodle: com.ddky.orderpicker.loginActivity$1$1 -> onInitFinished: onInitFinishedtrue  
D/Noodle: com.ddky.orderpicker.loginActivity$1 -> onClick: wfw112  
D/Noodle: com.ddky.orderpicker.loginActivity$1 -> onClick: com.ddky.orderpicker.loginActivity@21b6df6  
I/Quality: Skipped: false 1 cost 14.117581 refreshRate 8308467 bit true processName com.ddky.orderpicker
2024-10-22 19:49 负责人:无 分享
已邀请:
我就是小伟哥

我就是小伟哥 (作者)

没有人回答问题吗?
这也太安静了

程序员不掉发

程序员不掉发

你要确保初始化完毕吧,你是吧wgt包放远程还是项目里的

要回复问题请先登录注册