使用官方API示例同样闪退 let button = wx.createUserInfoButton({ type: 'text', text: '获取用户信息', style: { left: 10, top: 76, width: 200, height: 40, lineHeight: 40, backgroundColor: '#ff0000', color: '#ffffff', textAlign: 'center', fontSize: 16, borderRadius: 4 } }) button.onTap((res) => { console.log(res) }) 如此基础的模块失效,影响严重。希望官方尽快解决
微信个人信息成功授权后闪退,取消授权不闪退。每次必现其他细节: 授权弹窗可以拉起用户端取消授权不闪退其他wx底层实现:开发者工具、PC端、IOS端都正常btw,之前此逻辑一直没有问题,最近突然出现尝试以下三个方法,无法修复此问题:切换调试基础库(between 2.xx 3.xx)、更换手机、清除缓存游戏引擎:Unity转微信小游戏 Unity转换插件版本:202312131914 前端代码调用: // 之前调用wx.Login并且成功返回。 var vbtn = WX.CreateUserInfoButton( (int)rect.xMin, (int)rect.yMin, (int)rect.width, (int)rect.height, "zh_CN", true); Debug.Log($"rect {rect}"); // rect 大小位置正常 vbtn .OnTap(res => { // 此处用户同意授权必闪退 Debug.Log(res.errCode); Debug.Log(res.errMsg); }); 后台错误日志: 12-25 15:55:13.949 10071 10071 D AndroidRuntime: Shutting down VM 12-25 15:55:13.949 10071 10071 E AndroidRuntime: FATAL EXCEPTION: main 12-25 15:55:13.949 10071 10071 E AndroidRuntime: Process: com.tencent.mm:appbrand2, PID: 10071 12-25 15:55:13.949 10071 10071 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.b5.a(SourceFile:89) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.AppBrandRuntime.c(SourceFile:32) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at tv0.h$a.a(Unknown Source:12) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at ey0.g.o(SourceFile:11) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.jsapi.auth.JsApiOperateWXData$OperateWXDataTask$b.run(SourceFile:419) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.AppBrandRuntime.b1(SourceFile:50) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.AppBrandRuntime.a1(Unknown Source:2) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.jsapi.m.v(SourceFile:10) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.jsapi.auth.JsApiOperateWXData$OperateWXDataTask.g(SourceFile:412) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.tencent.mm.plugin.appbrand.ipc.k.run(SourceFile:35) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:264) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at qd4.k.run(SourceFile:247) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:942) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at pd4.f$b$a.dispatchMessage(SourceFile:28) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:240) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at android.os.Looper.loop(Looper.java:351) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8422) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) 12-25 15:55:13.949 10071 10071 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013) ----------------------------------------更新分割线------------------------------------------------------ 简化了复现方式。使用如下game.js代码,结果表现一样: // game.js ;(async()=>{ var settings = await wx.getSetting(); if(settings.authSetting['scope.userInfo']){ console.log(await wx.getUserInfo()); }else{ var vbtn = wx.createUserInfoButton({ type:"text", style:{ left : 100, top : 100, width:200, height:64, } }); vbtn.onTap(console.log) // 也是同意后闪退 } })();
2023-12-25从AndroidQ(10)开始,getProcessMemoryInfo限制了调用频率(默认5*60秒)。 参考: Android相关文档 相关常量和配置源码: ActivityManagerConstants.java 如何修改手机配置: adb连接设备,执行shell,修改频率限制为1秒: adb shell settings put global activity_manager_constants 'memory_info_throttle_time=1000' 上述命令可能出现Permission错误,则需要开启对应开发者选项,名如:"USB调试(安全设置)"、"禁止权限监控"等
Android性能监控面板cpu和内存一直不变?在安卓机上打开性能监控面板cpu和内寸一致保持不变 (切换页面、进入地图页 按理说这些监控数据应该改变的) 微信版本号 7.0.15
2023-12-25