编程语言
首页 > 编程语言> > Flutter 设置安卓启动页报错 java.lang.RuntimeException: Canvas: trying to draw too large(106,975,232 bytes) bi

Flutter 设置安卓启动页报错 java.lang.RuntimeException: Canvas: trying to draw too large(106,975,232 bytes) bi

作者:互联网

设置安卓启动页报错

image

<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" />
<!-- You can insert your own image assets here -->
     <item>
    <!-- android:gravity="center" -->
        <bitmap
         android:src="@drawable/splash"/>
    </item> 

https://stackoverflow.com/questions/39111248/canvas-trying-to-draw-too-large-bitmap-when-android-n-display-size-set-larger/44072270#44072270?newreg=b5b40430a64f4ad9b56afac076c58228

Move your image in the drawable to mipmap-xxhdpi.Your image is in bitmap format so you should put your image in mipmap folder,then it will work

image

<item>
    <bitmap android:src="@mipmap/splash" />
</item>

标签:lang,xml,Canvas,image,bitmap,报错,drawable,安卓
来源: https://www.cnblogs.com/r1cardo/p/15577540.html