andriod 8.0 启动就奔溃了,无法启动,查看日志后发现Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation,(log查看方式:adb logcat -I)
也就是说android 8.0 透明的activity 不能继续使用
综合其他大神的结论:
把android 下面的src下面的main下面res下面values下面的styles文件
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<!--设置透明背景-->
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowDisablePreview">true</item>
</style>
</resources>
windowIsTranslucent改为windowDisablePreview就能起到一样子的效果了,且应用不会崩溃了。
、
重新打包,即可