Skip to content

Android build fails with newArchEnabled=false since v2.5.3: missing paper variants of SkiaWebGPUViewManagerDelegate / Interface #3842

@HilSny

Description

@HilSny

Description

@shopify/react-native-skia v2.5.3 added the Android WebGPU view manager (WebGPUViewManager.java, WebGPUView.java, WebGPUSurfaceView.java, WebGPUTextureView.java, WebGPUViewAPI.java) but did not ship matching prebuilt paper-architecture variants of the codegen output (SkiaWebGPUViewManagerDelegate.java, SkiaWebGPUViewManagerInterface.java). As a result, any project with newArchEnabled=false on Android fails to compile.

Root cause

android/build.gradle only applies the React Native gradle plugin (which runs codegen) when New Architecture is enabled:

if (isNewArchitectureEnabled()) {
    apply plugin: "com.facebook.react"
}

WebGPUViewManager.java lives in android/src/main/java/ (always compiled) and unconditionally imports codegen output from com.facebook.react.viewmanagers. With new arch off, codegen never runs, so those classes don't exist.

The SkiaPictureView flow handles this correctly — paper variants are shipped in android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java and …Interface.java. The same files are missing for the WebGPU view.

It looks like the same class of bug fixed for SkiaPictureView in #3535 / v2.4.6, but applied to the new WebGPU view manager.

Versions affected (verified by extracting npm tarballs):

Version Has WebGPUViewManager.java Builds on old arch
2.5.2 No
2.5.3 Yes
2.5.5 Yes
2.6.2 Yes

Workaround

Pin to 2.5.2.

As a heads up I used AI to help generate this issue for me.

React Native Skia Version

2.6.2 (also reproducible on 2.5.3, 2.5.5)

React Native Version

0.81.6

Using New Architecture

  • Enabled

Steps to Reproduce

  1. In an Android project with newArchEnabled=false in android/gradle.properties
  2. Install @shopify/react-native-skia@2.6.2 (or any version ≥ 2.5.3)
  3. Run a release build: cd android && ./gradlew bundleProdRelease
  4. Build fails at :shopify_react-native-skia:compileReleaseJavaWithJavac with:
WebGPUViewManager.java:8: error: cannot find symbol
import com.facebook.react.viewmanagers.SkiaWebGPUViewManagerDelegate;
                                      ^
  symbol:   class SkiaWebGPUViewManagerDelegate
  location: package com.facebook.react.viewmanagers
WebGPUViewManager.java:9: error: cannot find symbol
import com.facebook.react.viewmanagers.SkiaWebGPUViewManagerInterface;
                                      ^
  symbol:   class SkiaWebGPUViewManagerInterface
WebGPUViewManager.java:19: error: cannot find symbol
  protected SkiaWebGPUViewManagerDelegate mDelegate;
            ^
  symbol:   class SkiaWebGPUViewManagerDelegate
  location: class WebGPUViewManager
WebGPUViewManager.java:15: error: cannot find symbol
public class WebGPUViewManager extends ReactViewManager implements SkiaWebGPUViewManagerInterface<WebGPUView> {
                                                                   ^
  symbol: class SkiaWebGPUViewManagerInterface
8 errors

Snack, Code Example, Screenshot, or Link to Repository

its a native error so a snack won't work

  1. In an Android project with newArchEnabled=false in android/gradle.properties
  2. Install @shopify/react-native-skia@2.6.2 (or any version ≥ 2.5.3)
  3. Run a release build: cd android && ./gradlew bundleProdRelease
  4. Build fails at :shopify_react-native-skia:compileReleaseJavaWithJavac with:
WebGPUViewManager.java:8: error: cannot find symbol
import com.facebook.react.viewmanagers.SkiaWebGPUViewManagerDelegate;
                                      ^
  symbol:   class SkiaWebGPUViewManagerDelegate
  location: package com.facebook.react.viewmanagers
WebGPUViewManager.java:9: error: cannot find symbol
import com.facebook.react.viewmanagers.SkiaWebGPUViewManagerInterface;
                                      ^
  symbol:   class SkiaWebGPUViewManagerInterface
WebGPUViewManager.java:19: error: cannot find symbol
  protected SkiaWebGPUViewManagerDelegate mDelegate;
            ^
  symbol:   class SkiaWebGPUViewManagerDelegate
  location: class WebGPUViewManager
WebGPUViewManager.java:15: error: cannot find symbol
public class WebGPUViewManager extends ReactViewManager implements SkiaWebGPUViewManagerInterface<WebGPUView> {
                                                                   ^
  symbol: class SkiaWebGPUViewManagerInterface
8 errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions