Expo SDK 33 Android standalone build crashes

I updated my App from SDK 32 to 33.
Everything works fine, but the standalone build (expo build:android).

After I download, install and run the build, the app shows a white screen for a few seconds and then closes with a popup “app has stopped Close app” on my Samsung S7 edge. I cleared cache / deinstalled multiple times. Even did a new build. My old SDK 32 app still works.

The strange thing is, the build works via the expo client, if I select it there.

It also works on Android Emulator on Windows,
on iOS Simulator on MacOS
and on my Samsung Galaxy Tab S3

Any ideas?

2 Likes

Hey @freshcells,

Can you try digging into the device logs via Android Studio? They are usually much more telling than the standard logs.

Cheers,
Adam

1 Like

Thanks for the great tip. I think this is the error:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.vendor.app, PID: 20360
java.lang.RuntimeException: Canvas: trying to draw too large(193632768bytes) bitmap.
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
at android.graphics.drawable.LayerDrawable.draw(LayerDrawable.java:1016)
at android.view.View.getDrawableRenderNode(View.java:20645)
at android.view.View.drawBackground(View.java:20581)
at android.view.View.draw(View.java:20361)
at com.android.internal.policy.DecorView.draw(DecorView.java:980)
at android.view.View.updateDisplayListIfDirty(View.java:19315)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:800)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3496)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3283)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2818)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1780)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7827)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
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)

I am using two bigger images:

  • splash screen: 1242x2436 PNG 8bit 82,27 kB
  • login background image (showing straight after the splash screen): 750x1334 PNG 24bit 575,89 kB

both were optimized by expo-cli (and working in SDK32).
There should be no bitmap with 193632768bytes.
I tried “cover” and “contain”.

Fixed the problem by adding the corresponding files to the “android” section of the app.json

{
  "expo": {
   ...
    "splash": {
      "image": "./src/assets/images/splash@4x.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "android": {
      ...
      "splash": {
        "resizeMode": "cover",
        "mdpi": "./src/assets/images/splash.png",
        "hdpi": "./src/assets/images/splash@1.5x.png",
        "xhdpi": "./src/assets/images/splash@2x.png",
        "xxhdpi": "./src/assets/images/splash@3x.png",
        "xxxhdpi": "./src/assets/images/splash@4x.png",
        "backgroundColor": "#ffffff"
      }
    }
  }
}

Thank you for pointing me into the right direction!

2 Likes

Hi !

I have the same crash but .I don’t really want to fix it by generating all the assets for Android.

@adamjnav Isn’t there an issue as the doc (https://docs.expo.io/versions/v33.0.0/guides/splash-screens/ ) specifies : “Given that we can resize and crop our splash image automatically, it looks like we can stick with our dimensions, as long as we don’t depend on the splash image fitting the screen exactly. This is convenient because we can use one splash image for both iOS and Android - less for you to read in this guide and less work for you to do.”

It was working with an "1242 pixels wide and 2436 pixels tall" on SDK 32.

Thank-you for your help

Hi,

I have same problem. I use samsung galaxy S9 Plus.
Here is my logs in case you need it.

2019-06-12 14:18:57.092 10505-10505/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.smartlog.bidding, PID: 10505
    java.lang.RuntimeException: Canvas: trying to draw too large(148250088bytes) bitmap.
        at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
        at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
        at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
        at android.widget.ImageView.onDraw(ImageView.java:1367)
        at android.view.View.draw(View.java:20338)
        at android.view.View.updateDisplayListIfDirty(View.java:19283)
        at android.view.View.draw(View.java:20061)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
        at android.view.View.updateDisplayListIfDirty(View.java:19274)
        at android.view.View.draw(View.java:20061)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
        at android.view.View.draw(View.java:20341)
        at android.view.View.updateDisplayListIfDirty(View.java:19283)
        at android.view.View.draw(View.java:20061)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
        at android.view.View.updateDisplayListIfDirty(View.java:19274)
        at android.view.View.draw(View.java:20061)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
        at android.view.View.updateDisplayListIfDirty(View.java:19274)
        at android.view.View.draw(View.java:20061)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
        at android.view.View.updateDisplayListIfDirty(View.java:19274)
        at android.view.View.draw(View.java:20061)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
        at android.view.View.draw(View.java:20341)
        at com.android.internal.policy.DecorView.draw(DecorView.java:979)
        at android.view.View.updateDisplayListIfDirty(View.java:19283)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:800)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:3447)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3234)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2769)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1738)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7745)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
        at android.view.Choreographer.doCallbacks(Choreographer.java:723)
        at android.view.Choreographer.doFrame(Choreographer.java:658)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        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)

I also got the same error. working on SDK 33, there is a fix for this ?

I’m having the same issue on SDK 33.

Did you made those different splash images yourself? And did you run expo optimize again before building?

I made them myself and i did run expo optimize after that.

@freshcells Don’t you think there is an issue on SDK 33 as I mentionned above ?

I have now also generated the images myself and tried the same approach as @freshcells, but now it crashes right after showing the splashscreen. I think I have to move back to sdk 32. Starting to get a lot of complaints and bad ratings because of this. Really frustrating.

1 Like

can you email support@expo.io with more information about your app so we can investigate?

I’ve just send an email to support. For now I downgraded to SDK32 for building the Android version and that fixed it.

i have same problem, im using as expokit 33.0
i already tried to setup apps.json in android.splash section like Freshcells suggested, but still not solved

App.json’s Splash doesn’t apply to stand-alone apps. How did you fix the stand-alone app by changing its settings?

I have the same issue with SDK 33, people were experiencing crashes on Android devices in production. I downgraded to SDK 32 and it’s now working fine.

1 Like

I am having the same issue too.

I had to add specific files for my splash screen image. This is valid workaround to not downgrade to SDK 32.

1 Like

I tried your workaround, but users were still experiencing the issue.

1 Like

hey folks, we have updated the build service to include this commit and it should resolve your issue. we’ll land this documentation change to explain how to use resizeMode: "native" shortly, or you can just read the pr now if you want

4 Likes