Closed gevorg-artex closed 4 years ago
The crash appears when starting camera activity on Android 8.0 device, nothing help to fix the issue
I fixed this issue changing screenOrientation to unspecified in the AndroidManifest.xml, like this ` <activity android:name=".ui.imagepicker.ImagePickerActivity" android:configChanges="orientation|screenSize" android:screenOrientation="unspecified" android:theme="@style/imagepicker_ImagePickerTheme" />
<activity
android:name=".ui.camera.CameraActivity"
android:screenOrientation="unspecified"
android:theme="@style/imagepicker_CameraTheme" />
`
I tried to as this way as setting unspecified orientation programmatically.
Easy way:
<activity android:name="com.nguyenhoanglam.imagepicker.ui.camera.CameraActivty" android:screenOrientation="unspecified" tools:replace="android:screenOrientation" />
ok thank you will try
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hi.hub/com.nguyenhoanglam.imagepicker.ui.camera.CameraActivty}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation at android.app.Activity.onCreate(Activity.java:986) at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:149) at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:313) at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:85) at com.nguyenhoanglam.imagepicker.ui.camera.CameraActivty.onCreate(CameraActivty.java:42) at android.app.Activity.performCreate(Activity.java:6975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)