亲爱的
请在下面找到Android Studio LOGCAT中引发的异常。任何建议都是可取的。
问题:在启动应用后,像三星j7之类的某些设备会立即使应用崩溃。
2019-11-22 13:45:02.015 28641-28641/? E/adbd: recv: OPEN 00000324 00000000 000b:6A 64 77 70 3A 32 39 35 30 31 00
2019-11-22 13:45:02.015 28641-28641/? E/adbd: service_to_fd: jdwp:29501
2019-11-22 13:45:02.031 28641-28641/? E/adbd: recv: OPEN 00000325 00000000 0041:73 68 65 6C 6C 3A 73 74 61 74 20 2D 63 20 25 75 20 2F 70 72 6F 63 2F 32 39 35 30 31 20 7C 20 78 61 72 67 73 20 2D 6E 20 31 20 70 6D 20 6C 69 73 74 20 70 61 63 6B 61 67 65 73 20 2D 2D 75 69 64 00
2019-11-22 13:45:02.031 28641-28641/? E/adbd: service_to_fd: shell:stat -c %u /proc/29501 | xargs -n 1 pm list packages --uid
2019-11-22 13:45:02.190 29501-29501/com.BankSoharMB E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.XXXXX, PID: 29501
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.XXX/com.XXXXX.XXXX}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
at android.app.Activity.onCreate(Activity.java:1038)
at org.apache.cordova.CordovaActivity.onCreate(CordovaActivity.java:228)
at com.BankSoharMB.BankSohar.onCreate(BankSohar.java:35)
at android.app.Activity.performCreate(Activity.java:7183)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
2019-11-22 13:45:02.240 3998-4017/? E/PhoneWindow_APM :: isCalledPackage return true
2019-11-22 13:45:02.525 29521-29521/? E/appproc: Enhanced Zygote ASLR: ro.knox.enhance.zygote.aslr != 1. Enhanced Zygote ASLR is DISABLED!
2019-11-22 13:45:02.687 29521-29521/? E/SemAffinityControl: SemAffinityControl: registerfunction enter
2019-11-22 13:45:02.749 5648-5780/? E/PBSessionCacheImpl: sessionId[24841741103137180] not persisted.
2019-11-22 13:45:03.175 29546-29546/? E/appproc: Enhanced Zygote ASLR: ro.knox.enhance.zygote.aslr != 1. Enhanced Zygote ASLR is DISABLED!
2019-11-22 13:45:03.333 29546-29546/? E/SemAffinityControl: SemAffinityControl: registerfunction enter
2019-11-22 13:45:06.517 28641-28641/? E/adbd: recv: OPEN 00000327 00000000 00f9:73 68 65 6C 6C 3A 67 65 74 70 72 6F 70 20 72 6F 2E 70 72 6F 64 75 63 74 2E 6D 6F 64 65 6C 0A 65 63 68 6F 20 3D 3D 3D 3D 3D 3D 3D 3D 20 6F 75 74 70 75 74 20 73 65 70 61 72 61 74 6F 72 20 3D 3D 3D 3D 3D 3D 3D 3D 0A 64 75 6D 70 73 79 73 20 77 69 6E 64 6F 77 20 70 6F 6C 69 63 79 0A 65 63 68 6F 20 3D 3D 3D 3D 3D 3D 3D 3D 20 6F 75 74 70 75 74 20 73 65 70 61 72 61 74 6F 72 20 3D 3D 3D 3D 3D 3D 3D 3D 0A 70 73 0A 65 63 68 6F 20 3D 3D 3D 3D 3D 3D 3D 3D 20 6F 75 74 70 75 74 20 73 65 70 61 72 61 74 6F 72 20 3D 3D 3D 3D 3D 3D 3D 3D 0A 63 61 74 20 2F 70 72 6F 63 2F 6E 65 74 2F 75 6E 69 78 0A 65 63 68 6F 20 3D 3D 3D 3D 3D 3D 3D 3D 20 6F 75 74 70 75 74 20 73 65 70 61 72 61 74 6F 72 20 3D 3D 3D 3D 3D 3D 3D 3D 0A 64 75 6D 70 73 79 73 20 75 73 65 72 0A 00
2019-11-22 13:45:06.517 28641-28641/? E/adbd: service_to_fd: shell:getprop ro.product.model
2019-11-22 13:45:06.517 28641-28641/? E/adbd: echo ======== output separator ========
2019-11-22 13:45:06.517 28641-28641/? E/adbd: dumpsys window policy
2019-11-22 13:45:06.517 28641-28641/? E/adbd: echo ======== output separator ========
2019-11-22 13:45:06.517 28641-28641/? E/adbd: ps
2019-11-22 13:45:06.518 28641-28641/? E/adbd: echo ======== output separator ========
2019-11-22 13:45:06.518 28641-28641/? E/adbd: cat /proc/net/unix
2019-11-22 13:45:06.518 28641-28641/? E/adbd: echo ======== output separator ========
2019-11-22 13:45:06.518 28641-28641/? E/adbd: dumpsys user
2019-11-22 13:45:06.790 28641-28641/? E/adbd: recv: OPEN 00000328 00000000 0025:6C 6F 63 61 6C 61 62 73 74 72 61 63 74 3A 63 68 72 6F 6D 65 5F 64 65 76 74 6F 6F 6C 73 5F 72 65 6D 6F 74 65 00
2019-11-22 13:45:06.790 28641-28641/? E/adbd: service_to_fd: localabstract:chrome_devtools_remote
2019-11-22 13:45:06.798 28641-28641/? E/adbd: recv: OPEN 00000329 00000000 0025:6C 6F 63 61 6C 61 62 73 74 72 61 63 74 3A 63 68 72 6F 6D 65 5F 64 65 76 74 6F 6F 6C 73 5F 72 65 6D 6F 74 65 00 ```
答案 0 :(得分:1)
如果任何活动显示为对话框或主题设置为不透明,则不允许设置方向。
如果您正在使用
android:screenOrientation="portrait"
移至行上方。