vonovak / react-native-theme-control

Natively control react native application theme at runtime and persist it for the next app start.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android builds with Expo 49 fail

Armster15 opened this issue Β· comments

First off, thank you so much for building this. I've been looking for something like this for quite some time.
The library works perfectly fine for me for Expo iOS builds, but for me Android builds fail.

Here is a base repository where you can reproduce the error: https://github.com/Armster15/theme-control-reproducible/

To note, I am using Expo 49 with React Native 72.

Steps to reproduce

  1. Create a new expo app with create-expo-app. I used Yarn v1 for the package manager but I don't think it should make a difference.
  2. Install @vonovak/react-native-theme-control and expo-system-ui (the latter is required in order for Expo to recognize the userInterfaceStyle property in app.json)
  3. In app.json, update the value of the userInterfaceStyle property to be automatic
  4. Create a plugins property, where the value is ["@vonovak/react-native-theme-control"]
  5. Run yarn expo run:android to trigger a build
  6. See the following error:
> Task :vonovak_react-native-theme-control:packageDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':vonovak_react-native-theme-control:packageDebugResources' (type 'MergeResources').
  - Gradle detected a problem with the following location: '/Users/xx/Desktop/theme-control-debug/node_modules/@vonovak/react-native-theme-control/android/build/generated/res/rs/debug'.
    
    Reason: Task ':vonovak_react-native-theme-control:packageDebugResources' uses this output of task ':vonovak-react-native-theme-control:compileDebugRenderscript' 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 ':vonovak-react-native-theme-control:compileDebugRenderscript' as an input of ':vonovak_react-native-theme-control:packageDebugResources'.
      2. Declare an explicit dependency on ':vonovak-react-native-theme-control:compileDebugRenderscript' from ':vonovak_react-native-theme-control:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':vonovak-react-native-theme-control:compileDebugRenderscript' from ':vonovak_react-native-theme-control:packageDebugResources' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/xx/Desktop/theme-control-debug/node_modules/@vonovak/react-native-theme-control/android/build/generated/res/resValues/debug'.
    
    Reason: Task ':vonovak_react-native-theme-control:packageDebugResources' uses this output of task ':vonovak-react-native-theme-control: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 ':vonovak-react-native-theme-control:generateDebugResValues' as an input of ':vonovak_react-native-theme-control:packageDebugResources'.
      2. Declare an explicit dependency on ':vonovak-react-native-theme-control:generateDebugResValues' from ':vonovak_react-native-theme-control:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':vonovak-react-native-theme-control:generateDebugResValues' from ':vonovak_react-native-theme-control:packageDebugResources' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Once again, thank you so much for this awesome library!

Hello and thanks for reporting,
Thank you for your kind words and for including a runnable reproduction! πŸ’― I don't see that nearly enough πŸ™ˆ πŸ˜„ .
The issue should be fixed in the next version.

Thank you πŸ™‚

πŸŽ‰ This issue has been resolved in version 4.1.2 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€