react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Not working with Expo SDK 54

Open ferretwithaberet opened this issue 3 months ago • 12 comments

Description

When I try to upgrade from Expo SDK 53 to SDK 54 I am getting the following output:

[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem was found with the configuration of task ':uilib-native:packageDebugResources' (type 'MergeResources').
[RUN_GRADLEW]   - Gradle detected a problem with the following location: '/var/tmp/expo-builds/9495f0be-3c28-4d35-8634-8561c19973c1/build/node_modules/uilib-native/android/build/generated/res/resValues/debug'.
[RUN_GRADLEW]     
[RUN_GRADLEW]     Reason: Task ':uilib-native:packageDebugResources' uses this output of task ':react-native-ui-lib:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
[RUN_GRADLEW]     
[RUN_GRADLEW]     Possible solutions:
[RUN_GRADLEW]       1. Declare task ':react-native-ui-lib:generateDebugResValues' as an input of ':uilib-native:packageDebugResources'.
[RUN_GRADLEW]       2. Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#dependsOn.
[RUN_GRADLEW]       3. Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#mustRunAfter.
[RUN_GRADLEW]     
[RUN_GRADLEW]     For more information, please refer to https://docs.gradle.org/8.14.3/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Declare task ':react-native-ui-lib:generateDebugResValues' as an input of ':uilib-native:packageDebugResources'
[RUN_GRADLEW] > Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#dependsOn
[RUN_GRADLEW] > Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#mustRunAfter
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] BUILD FAILED in 7m 32s
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Related to

  • [ ] Components
  • [ ] Demo
  • [ ] Docs
  • [ ] Typings

Steps to reproduce

  1. Create expo SDK 54 app;
  2. Install react-native-ui-lib;
  3. Create a development build.

Expected behavior

Library should build correctly.

Actual behavior

Errors during build process.

More Info

Code snippet



Screenshots/Video

Environment

  • React Native version: 0.81.4
  • React Native UI Lib version: 7.46.3

Affected platforms

  • [x] Android
  • [ ] iOS
  • [ ] Web

ferretwithaberet avatar Sep 14 '25 13:09 ferretwithaberet

Description

When I try to upgrade from Expo SDK 53 to SDK 54 I am getting the following output:

[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem was found with the configuration of task ':uilib-native:packageDebugResources' (type 'MergeResources').
[RUN_GRADLEW]   - Gradle detected a problem with the following location: '/var/tmp/expo-builds/9495f0be-3c28-4d35-8634-8561c19973c1/build/node_modules/uilib-native/android/build/generated/res/resValues/debug'.
[RUN_GRADLEW]     
[RUN_GRADLEW]     Reason: Task ':uilib-native:packageDebugResources' uses this output of task ':react-native-ui-lib:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
[RUN_GRADLEW]     
[RUN_GRADLEW]     Possible solutions:
[RUN_GRADLEW]       1. Declare task ':react-native-ui-lib:generateDebugResValues' as an input of ':uilib-native:packageDebugResources'.
[RUN_GRADLEW]       2. Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#dependsOn.
[RUN_GRADLEW]       3. Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#mustRunAfter.
[RUN_GRADLEW]     
[RUN_GRADLEW]     For more information, please refer to https://docs.gradle.org/8.14.3/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Declare task ':react-native-ui-lib:generateDebugResValues' as an input of ':uilib-native:packageDebugResources'
[RUN_GRADLEW] > Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#dependsOn
[RUN_GRADLEW] > Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#mustRunAfter
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] BUILD FAILED in 7m 32s
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Related to

  • [ ] Components[ ] Demo[ ] Docs[ ] Typings

Steps to reproduce

  1. Create expo SDK 54 app;
  2. Install react-native-ui-lib;
  3. Create a development build.

Expected behavior

Library should build correctly.

Actual behavior

Errors during build process.

More Info

Code snippet


Screenshots/Video

Environment

  • React Native version: 0.81.4
  • React Native UI Lib version: 7.46.3

Affected platforms

  • [x] Android[ ] iOS[ ] Web

Same issue

ArkanJbali avatar Sep 17 '25 09:09 ArkanJbali

Par for the course with react-native-ui-lib unfortunately... hopefully this gets addressed soon...

Bengejd avatar Sep 21 '25 17:09 Bengejd

I tried patching the react-native-ui-lib and uilib-native packages for multiple hours 2 days in a row. I could not find any patch, but I am also not an Android/Gradle expert. When I tried resolving the task dependencies, other task dependency errors would pop up, this whole chain of setting dependsOn on each task just led me to circular dependency errors. Seems like we might have to wait for #3718 to get merged into master and hopefully that will solve our issues.

ferretwithaberet avatar Sep 21 '25 22:09 ferretwithaberet

I tried patching the react-native-ui-lib and uilib-native packages for multiple hours 2 days in a row. I could not find any patch, but I am also not an Android/Gradle expert. When I tried resolving the task dependencies, other task dependency errors would pop up, this whole chain of setting dependsOn on each task just led me to circular dependency errors. Seems like we might have to wait for #3718 to get merged into master and hopefully that will solve our issues.

Same. I run into circular dependency errors too.

rckmath avatar Sep 21 '25 22:09 rckmath

This seems to be an issue with react native autolinking and creating circular dependencies within gradle.

WARNING: Please do your own complete testing of the solution fully, I do not focus on Android as a priority. iOS is where my main focus is

Affected Versions:

  • Expo SDK 54+
  • react-native-ui-lib ^7.46.3
  • react-native 0.81.4

Root Cause: What worked for me was removing the android autolinking reference in the main project react-native.config.js.

I found that stricter autolinking and dependency management was introduced with these upgrades. The issue occurs because: react-native-ui-lib has uilib-native as a dependency Both packages were trying to autolink the same native code This created duplicate native module registration that was previously allowed but now flags as an error

Proposed Solution: Disable autolinking for the main react-native-ui-lib package by updating its react-native.config.js:

module.exports = {
  dependency: {
    platforms: {
      android: null, // Disable autolinking - native code comes from uilib-native dependency in package.json
      ios: null
    }
  }
};

Using patch-package on "react-native-ui-lib": "^7.46.3":

diff --git a/node_modules/react-native-ui-lib/react-native.config.js b/node_modules/react-native-ui-lib/react-native.config.js
index ef376f5..2df2f40 100644
--- a/node_modules/react-native-ui-lib/react-native.config.js
+++ b/node_modules/react-native-ui-lib/react-native.config.js
@@ -6,17 +6,7 @@ module.exports = {
       // ios: {
       //   podspecPath: './lib/ReactNativeUiLib.podspec'
       // },
-      android: {
-        sourceDir: '../uilib-native/android/',
-        packageImportPath: `import com.wix.reactnativeuilib.dynamicfont.DynamicFontPackage;
-import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
-import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
-import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;`,
-        packageInstance: `new DynamicFontPackage(),
-      new HighlighterViewPackage(),
-      new TextInputDelKeyHandlerPackage(),
-      new KeyboardInputPackage(getApplication())`
-      }
+      android: null
     }
   }
 };

Testing: I verified the fix by testing native components like FeatureHighlight - if they render correctly, the native bridge is working through the proper autolinking chain.

  • FeatureHighlight (uses HighlighterOverlayView from uilib-native)

I would be interested in what the main contributors of this library think of this issue. If anyone tries this fix in their app, please share testing results so we can continue to work through a solution and help others! :)

jdelaney3097 avatar Sep 23 '25 04:09 jdelaney3097

@jdelaney3097 You're a godsend. I haven't tested it out yet, but the build just went through a few minutes ago. I'll report back if it ends up working as normal. It would be sweet if I didn't have to downgrade back to 53.

Bengejd avatar Sep 23 '25 23:09 Bengejd

I tried the suggest fix and it did not work for me:

diff --git a/node_modules/react-native-ui-lib/lib/react-native.config.js b/node_modules/react-native-ui-lib/lib/react-native.config.js
index d5fe52a..2df2f40 100644
--- a/node_modules/react-native-ui-lib/lib/react-native.config.js
+++ b/node_modules/react-native-ui-lib/lib/react-native.config.js
@@ -6,17 +6,7 @@ module.exports = {
       // ios: {
       //   podspecPath: './lib/ReactNativeUiLib.podspec'
       // },
-      android: {
-        sourceDir: './android/',
-        packageImportPath: `import com.wix.reactnativeuilib.dynamicfont.DynamicFontPackage;
-import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
-import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
-import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;`,
-        packageInstance: `new DynamicFontPackage(),
-      new HighlighterViewPackage(),
-      new TextInputDelKeyHandlerPackage(),
-      new KeyboardInputPackage(getApplication())`
-      }
+      android: null
     }
   }
 };

This is the error that I am getting in Expo EAS Android build:

FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':uilib-native:packageDebugResources' (type 'MergeResources').
  - Gradle detected a problem with the following location: '/home/expo/workingdir/build/node_modules/uilib-native/android/build/generated/res/resValues/debug'.
    
    Reason: Task ':uilib-native:packageDebugResources' uses this output of task ':react-native-ui-lib:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':react-native-ui-lib:generateDebugResValues' as an input of ':uilib-native:packageDebugResources'.
      2. Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.14.3/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
* Try:
> Declare task ':react-native-ui-lib:generateDebugResValues' as an input of ':uilib-native:packageDebugResources'
> Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#dependsOn
> Declare an explicit dependency on ':react-native-ui-lib:generateDebugResValues' from ':uilib-native:packageDebugResources' using Task#mustRunAfter

titanve avatar Sep 24 '25 00:09 titanve

I tried the patch and it works.

I tried the suggest fix and it did not work for me:

You patched react-native-ui-lib/lib/react-native.config.js while they said you need to patch react-native-ui-lib/react-native.config.js. There is no react-native.config.js file in the lib/ directory.

ferretwithaberet avatar Sep 24 '25 12:09 ferretwithaberet

@ferretwithaberet oops! Good catch, I will try again. Thanks.

titanve avatar Sep 26 '25 15:09 titanve

@ferretwithaberet you were right, thank you so much! 💪 also thank you, @jdelaney3097

titanve avatar Sep 27 '25 19:09 titanve

Tried

  • I tried to solve a problem by patching react-native.config.js

* What went wrong:
A problem was found with the configuration of task ':uilib-native:copyReleaseJniLibsProjectOnly' (type 'LibraryJniLibsTask').
  - Gradle detected a problem with the following location: '/Users/ermapsh/Devlopement/gst/patgpt/node_modules/uilib-native/android/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out'.
    
    Reason: Task ':uilib-native:copyReleaseJniLibsProjectOnly' uses this output of task ':react-native-ui-lib:mergeReleaseNativeLibs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':react-native-ui-lib:mergeReleaseNativeLibs' as an input of ':uilib-native:copyReleaseJniLibsProjectOnly'.
      2. Declare an explicit dependency on ':react-native-ui-lib:mergeReleaseNativeLibs' from ':uilib-native:copyReleaseJniLibsProjectOnly' using Task#dependsOn.
      3. Declare an explicit dependency on ':react-native-ui-lib:mergeReleaseNativeLibs' from ':uilib-native:copyReleaseJniLibsProjectOnly' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.14.3/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

* Try:
> Declare task ':react-native-ui-lib:mergeReleaseNativeLibs' as an input of ':uilib-native:copyReleaseJniLibsProjectOnly'
> Declare an explicit dependency on ':react-native-ui-lib:mergeReleaseNativeLibs' from ':uilib-native:copyReleaseJniLibsProjectOnly' using Task#dependsOn
> Declare an explicit dependency on ':react-native-ui-lib:mergeReleaseNativeLibs' from ':uilib-native:copyReleaseJniLibsProjectOnly' using Task#mustRunAfter
> Run with --scan to get full insights.

How did you solve this issue @titanve

ErMapsh avatar Nov 06 '25 11:11 ErMapsh

@ErMapsh

How did you solve this issue @titanve

It didn’t work for me either because I patched the wrong file. Check this comment: https://github.com/wix/react-native-ui-lib/issues/3805#issuecomment-3328141176

After applying the correct patch, it worked. I tried many other solutions before, but this was the only one that worked.

algreat2 avatar Nov 06 '25 11:11 algreat2