[0]laya native打包出的安卓项目下,引擎会自己注册SensorManager,如何禁用
在打包成APP上线头条的时候,头条会检查是否在隐私协议同意前调用传感器注册和使用,现在已经在onCreate中不调用initGame和initEngine两个函数,还是会在onResume中调用,头条反馈的堆栈信息如下
at android.hardware.SensorManager.registerListener(SensorManager.java:822)
at android.hardware.SensorManager.registerListener(SensorManager.java:730)
at android.view.OrientationEventListener.enable(OrientationEventListener.java:93)
at com.bytedance.applog.devtools.c.onActivityResumed(null:14)
at android.app.Application.dispatchActivityResumed(Application.java:436)
at android.app.Activity.dispatchActivityResumed(Activity.java:1270)
at android.app.Activity.onResume(Activity.java:1796)
at demo.MainActivity.onResume(null:0)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1453)
at android.app.Activity.performResume(Activity.java:7962)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4199)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4241)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7432)
at java.lang.reflect.Method.invoke(Method.java:-2)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
at android.hardware.SensorManager.registerListener(SensorManager.java:822)
at android.hardware.SensorManager.registerListener(SensorManager.java:730)
at android.view.OrientationEventListener.enable(OrientationEventListener.java:93)
at com.bytedance.applog.devtools.c.onActivityResumed(null:14)
at android.app.Application.dispatchActivityResumed(Application.java:436)
at android.app.Activity.dispatchActivityResumed(Activity.java:1270)
at android.app.Activity.onResume(Activity.java:1796)
at demo.MainActivity.onResume(null:0)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1453)
at android.app.Activity.performResume(Activity.java:7962)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4199)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4241)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7432)
at java.lang.reflect.Method.invoke(Method.java:-2)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
lv
赞同来自:
apploader.js里面删除conch.setSensorAble(true);试试
3.x可以直接把注册代码删了