expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
34.36k stars 5.49k forks source link

[SDK 52][expo-image] Outdated proguard configuration causing `IllegalArgumentException` in `source` prop on `ExpoImage` #32739

Closed thespacemanatee closed 3 days ago

thespacemanatee commented 5 days ago

Minimal reproducible example

https://github.com/thespacemanatee/expo-image-repro

What platform(s) does this occur on?

Android

Where did you reproduce the issue?

in a standalone app

Summary

The proguard-rules.pro in expo-image@2.0.0-preview.1 are not updated to reflect the latest changes. I have reported issues related to outdated proguard configuration before and suggest that the Expo team enable proguard in test builds to catch these issues earlier.

Problem line:

https://github.com/expo/expo/blob/46cedbc307e8c79b861c4c7340458313e9374022/packages/expo-image/android/src/main/java/expo/modules/image/ExpoImageModule.kt#L191

Related PR(s): #31098 #31440

Stacktrace:

❌ Cannot set the 'ExpoImage' prop on the 'm4.k{9250796 V.E...... ......I. 0,0-0,0 #6}'
                                                                                                    I4.v: Cannot set prop 'source' on view 'class m4.k'
                                                                                                    → Caused by: java.lang.IllegalArgumentException: Class declares 0 type parameters, but 3 were provided.
                                                                                                        at expo.modules.kotlin.views.c.c(SourceFile:85)
                                                                                                        at expo.modules.kotlin.views.q.k(SourceFile:66)
                                                                                                        at expo.modules.kotlin.views.GroupViewManagerWrapper.updateProperties(SourceFile:3)
                                                                                                        at expo.modules.kotlin.views.GroupViewManagerWrapper.updateProperties(SourceFile:1)
                                                                                                        at com.facebook.react.uimanager.ViewManager.createViewInstance(SourceFile:7)
                                                                                                        at com.facebook.react.uimanager.ViewManager.createView(SourceFile:1)
                                                                                                        at com.facebook.react.fabric.mounting.SurfaceMountingManager.createViewUnsafe(SourceFile:69)
                                                                                                        at com.facebook.react.fabric.mounting.SurfaceMountingManager.preallocateView(SourceFile:25)
                                                                                                        at com.facebook.react.fabric.mounting.mountitems.PreAllocateViewMountItem.execute(SourceFile:49)
                                                                                                        at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(SourceFile:54)
                                                                                                        at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchPreMountItems(SourceFile:64)
                                                                                                        at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(SourceFile:86)
                                                                                                        at com.facebook.react.fabric.GuardedFrameCallback.doFrame(SourceFile:1)
                                                                                                        at com.facebook.react.modules.core.a.g(SourceFile:37)
                                                                                                        at com.facebook.react.modules.core.a.a(SourceFile:1)
                                                                                                        at y2.i.doFrame(SourceFile:1)
                                                                                                        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1404)
                                                                                                        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
                                                                                                        at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
                                                                                                        at android.view.Choreographer.doFrame(Choreographer.java:941)
                                                                                                        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                        at android.os.Looper.loop(Looper.java:317)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8674)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Proguard disabled Proguard enabled
Screenshot_1731132289 Screenshot_1731132150

Environment

expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 15.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.9.0 - ~/.asdf/installs/nodejs/20.9.0/bin/node
      Yarn: 1.22.22 - ~/.asdf/installs/nodejs/20.9.0/bin/yarn
      npm: 10.1.0 - ~/.asdf/plugins/nodejs/shims/npm
      Watchman: 2024.10.14.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.15.2 - /Users/thespacemanatee/.asdf/shims/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
      Android SDK:
        API Levels: 23, 26, 29, 30, 31, 32, 33, 34, 35
        Build Tools: 26.0.3, 29.0.2, 30.0.3, 31.0.0, 33.0.0, 33.0.1, 33.0.2, 34.0.0, 34.0.0, 35.0.0
        System Images: android-33 | Desktop ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a, android-34 | Google Play ARM 64 v8a, android-34 | Google Play Tablet ARM 64 v8a, android-VanillaIceCream | Google APIs ARM 64 v8a, android-VanillaIceCream | Google Play ARM 64 v8a
    IDEs:
      Xcode: 16.1/16B40 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~52.0.0-preview.23 => 52.0.0-preview.23 
      expo-router: ~4.0.0-preview.14 => 4.0.0-preview.14 
      react: 18.3.1 => 18.3.1 
      react-dom: 18.3.1 => 18.3.1 
      react-native: 0.76.1 => 0.76.1 
      react-native-web: ~0.19.13 => 0.19.13 
    npmGlobalPackages:
      eas-cli: 12.5.1
    Expo Workflow: bare

Expo Doctor Diagnostics

Enabled experimental React Native Directory checks. Unset the EXPO_DOCTOR_ENABLE_DIRECTORY_CHECK environment variable to disable this check.
✔ Check package.json for common issues
✔ Check Expo config for common issues
✔ Check for common project setup issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for issues with Metro config
✔ Check if the project meets version requirements for submission to app stores
✖ Check for app config fields that may not be synced in a non-CNG project
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Validate packages against React Native Directory package metadata
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that packages match versions required by installed Expo SDK
✔ Check native tooling versions
✔ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

This project contains native project folders but also has native configuration properties in app.json, indicating it is configured to use Prebuild. When the android/ios folders are present, if you don't run prebuild in your build pipeline, the following properties will not be synced: orientation, icon, scheme, userInterfaceStyle, ios, android, plugins, androidStatusBar. 
expo-bot commented 4 days ago

Thank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.