Closed NunciosChums closed 6 years ago
I had the same issue, the only fix i found for now is to use android support library 26.1.0. Its seems to be a problem with android library 27.0.0.
@GrayaMax can you tell me more information?
@JSpiner sorry I don't have more information, i realized i get this error when i upgraded appcompat-v7 to version 27.0.0. So for now i return to version 26.1.0 and it still working. I will post more information if I find more.
@susemi99 @GrayaMax @JSpiner
There are some problem.
After 27( Android O), If we use android:screenOrientation="portrait"
in manifest, we got error like that.
If I remove that, we can solve.
But I dont think that is real solution.
I want to reason and try to real solution.
For Android developers, Recommend to use targetSdkVersion as 26 instead of 27 for a while.
Fix that worked for us
targetSdkVersion 27
and add TedPermissionActivity to your manifest where you override android:screenOrientation
<activity android:name="com.gun0912.tedpermission.TedPermissionActivity" android:configChanges="mcc|mnc|locale|keyboard|keyboardHidden|screenLayout|fontScale|uiMode|orientation|screenSize|layoutDirection" android:screenOrientation="unspecified" android:theme="@style/Theme.Transparent.Permission" tools:replace="android:screenOrientation"/>
?? can you explain it in more detail?
@andreas- Great. It works!
@ParkSangGwon According to this commit. Since android 'O'(26), we should satisfy following condition.
if (ActivityInfo.isFixedOrientation(requestedOrientation) && !fullscreen
&& appInfo.targetSdkVersion >= O) {
throw new IllegalStateException("Only fullscreen activities can request orientation");
}
I think some of these solutions are possible.
Enable fullscreen
TedPermissionActivity
is transparent. It doesn't matter.Set screenOrientation as unspecified
Customize
setScreenOrientation()
function at PermissionBuilder
Trick Code
unspecified
.Give me your opinion. I'll make PR.
@JSpiner i'd suggest to go with option 2 We experienced wonky behavior when dealing with fullscreen activities and immersive mode. This library should not make assumptions about the orientation
@BoxResin glad i could help
@andreas- I totally agree with you! Also, I think it should support option 3.
add
setScreenOrientation()
function atPermissionBuilder
So I'll make PR using 1/3 option.
This issue solved at 842b86f And I will publish new version. Thanks all guys
Please update new version with this issue, thank you.
+1
+1
+1
+1
+1
1+
+1
same problem. thanks for the explain 👍
I'm still getting this problem. Was the fix pushed?
how to create only android:screenOrientation="portrait"
?
can you help me
The problem is fixed in version gun0912.ted:tedpermission:2.2.0 but if you use gun0912.ted:tedpermission:2.2.2 with target version 28 the App will crash.
version: tedpermission-rx2:2.0.3 phone: emulator Nexus 5X 26, 27