Coder Social home page Coder Social logo

maxkomarychev / react-native-ultimate-config Goto Github PK

View Code? Open in Web Editor NEW
251.0 7.0 29.0 8.89 MB

Config that works

License: MIT License

Java 19.20% JavaScript 43.40% Starlark 1.21% Ruby 7.04% Objective-C 10.86% Handlebars 2.71% C 1.28% HTML 3.47% CSS 1.88% TypeScript 7.01% Objective-C++ 1.94%
react-native ios android env environment dotenv config xcconfig objective-c java

react-native-ultimate-config's Introduction

react-native-ultimate-config

Config that works

NPM npm npm

Project generated with https://github.com/brodybits/create-react-native-module

Suport of gradle

react-native-ultimate-config gradle
^3 <=6
>4 7

TL;DR usage

  1. install
    npm yarn
    npm install react-native-ultimate-config yarn add react-native-ultimate-config
  2. one-off setup for native projects
  3. initialize env
    npm yarn
    npm run rnuc <env file> yarn rnuc <env file>
  4. build! react-native run-{ios,android}

☝❗Approach to versioning and breaking changes

This library is using semver and heavily relying on codegeneration. Many new features and/or bugfixes will require these files to be regenerated. Changes to codegenerated files will not be considered breaking unless they affect behavior of API or CLI.

Therefore every time this library is updated all files MUST be regenerated using rnuc command.

Table of contents

  1. Features 🎆
  2. Mission 🥾
  3. Quickstart Guide 🏃
  4. API 🧰
  5. Changelog 📓
  6. Cookbook 🥦
  7. Troubleshooting 🎱
  8. Contributor notes
  9. Alternatives

Features

  1. Simple one-off setup for native projects
  2. No need to mess with xcode schemes or android flavors
  3. Access from javascript
  4. Access from native code: java and objective-c
  5. Access in build tools: xcode, gradle and AndroidManifest.xml
  6. Web support (works with React Native for Web)
  7. Hooks
  8. Monorepo support (yarn workspaces or lerna)
  9. Unit tested with jest
  10. E2E tested with detox
  11. Provides typescript typings
  12. Supports dotenv and yaml
  13. Fully typed values available when using yaml config
  14. Configure values per platform in one file

Mission

React-Native brings together 3 platforms: ios, android, javascript each of which have different conventions and approaches how to manage environment settings.

A typical app is usually operating in some environment defined by server urls various api keys or feature flags. When dealing with react-native such things often need to exist in 3 places: ios, android and js code. Even managing things as simple as application name or bundle id needs to be done in 2 places: Info.plist and AndroidManifest.xml

react-native-ultimate-config tries to reduce friction in managing these things by abstracting away from nuances of native projects.

With react-native-ultimate-config it is possible to consume variables in every place of a typical react-native app:

  • javascript
  • native code
    • java
    • objective-c
  • native build configuration
    • ios
      • build settings
      • infoplist
    • android
      • build config
      • string resources
      • project.ext
|-------------------------------------------------------|
|                                                       |
|                     javascript                        |
|                                                       |
|-------------------------------------------------------|
|                          |                            |
|       objective-c        |           java             |
|                          |                            |
|-------------------------------------------------------|
|                          |                            |
|      build settings      |     AndroidManifest.xml    |
|         infoplist        |        build.gradle        |
|                          |                            |
|-------------------------------------------------------|

react-native-ultimate-config's People

Contributors

atomheartother avatar dayze avatar elliotdickison avatar irohitb avatar isilher avatar maxkomarychev avatar menardi avatar samermurad avatar sdenaci avatar vagnerlandio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-ultimate-config's Issues

Gradle 7 Maven Plugin is Removed

Upgraded to 3.4.1 today, but ran into another error

Build file '/Users/username/Workspace/appname/node_modules/react-native-ultimate-config/android/build.gradle' line: 23

  • What went wrong:
    A problem occurred evaluating project ':react-native-ultimate-config'.
    Plugin with id 'maven' not found.

According to the official doc here, maven-publish plugin should be used instead.

https://docs.gradle.org/7.0/userguide/upgrading_version_6.html?_ga=2.13318143.933978241.1630988644-1794747336.1630988644#removal_of_the_legacy_maven_plugin

Ability for xcode to run an rnuc command

Hey Max,

This is more of a feature request than an issue report. Also, please tell me if I'm getting annoying :-P.

During my every day dev, the rnuc scripts inside my npm scripts work perfectly well for dev/staging environments.

However, manually setting the environment via npm for xcode leaves plenty of room for error (and wouldn't work if you're doing it in some sort of pipeline)

So the question is, inside a specific schema (or for archive), how can I have it run an rnuc command from inside the build pre-actions?

Something like...
image

I barely know what I'm doing with bash/xcode so I'm quite unfamiliar with how these work. I figure you'll get other people asking the same thing, so if this is the right approach to have it set up a particular set of environment variables on build then you could update the documentation to explain this.

Confused about rnuc vs. react-native-ultimate-config

Hey, I have it working but just curious.

I'm using NPM, not yarn, so I have it installed via npm -E react-native-ultimate-config

Then in order to actually run the scripts I'm currently doing npx yarn rnuc './.deploy/.stage.env'

What is "rnuc" specifically? Is that a separate package?

If that's obvious to people who use yarn all the time, it might be worth explaining in the docs.

working with android release variant

Hi! I love your library so much and we are so excited to incorporate it into our app. It will really solve a lot of our problems.
Everything is working great for us on iOS, and in android debug variant. However, when we go to build in release variant, app, immediately crashes, with this as a typical kind of error
null is not an object (evaluating 'f.default.KEY')

Is there some special step we have to take to get the library to work in release variant?

Thanks so much for your time and all the work you have put into this library!

RN issue: Cannot choose between the following variants of com.facebook.react:react-native

Describe the bug

Please see facebook/react-native#35210 for the full explanation. The suggested fix in this case would be to bump the react-native dependency to: 0.64.4 (https://github.com/facebook/react-native/releases/tag/v0.64.4)

Steps to Reproduce

nvm install lts/hydrogen
nvm use lts/hydrogen
npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init AwesomeProject
cd AwesomeProject
npx react-native start
npx react-native run-android

The app should launch without issues. Stop Metro. Kill the App. Then

npm i react-native-ultimate-config
npx react-native start
npx react-native run-android

And you should get something like

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/.../AwesomeProject/node_modules/react-native-ultimate-config/android/build.gradle' line: 113

* What went wrong:
A problem occurred configuring project ':react-native-ultimate-config'.
> Could not resolve all files for configuration ':react-native-ultimate-config:implementation'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-ultimate-config
      > Cannot choose between the following variants of com.facebook.react:react-native:0.70.5:
          - debugVariantDefaultRuntimePublication
          - releaseVariantDefaultRuntimePublication
        All of them match the consumer attributes:
          - Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.5:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'debug' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Variant 'releaseVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.5:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'release' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it

Expected behavior

The app should continue running without issues.

OS

  • ios
  • android

Thank you for this awesome tool :)

fastlane integration

Are there any plans to provide integration with fastlane env?
I guess Fastlane can accept the same files but the main issue is a location of the env files — Fastlane expects them to be in the same directory but they are in the project's root.

Motivation and Vision of this Package

Hello!
As I'm sure you surmised, I learnt about this package from your comment in the maintenance discussion thread of react-native-config.
It looks like, at least for now, this project is probably a safer bet for me to use since you're actively maintaining it. However, I am curious about your vision for this repo.
For example: what motivated you to put in the time to make this? Was it due to that thread I linked? Or something else? Also, do you plan to eventually get this merged into the react-native-community organization, or you plan to maintain this alone for the foreseeable future?

expo 47 compatible ?

Hello thank you so much for the amazing tool

Does this library support expo?

when i give an npx create-expo-app and configure the library it always has several errors.

Is there a possibility to configure it along with the expo?

PS: Sorry for my English I'm not native

Android JCenter - build failure

This library still relies on the jcenter repository. It should be migrated to maven central.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-ultimate-config:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-ultimate-config:releaseRuntimeClasspath'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-ultimate-config
      > Failed to list versions for com.facebook.react:react-native.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
            > Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
               > Read timed out

Product Flavors | Value null for applicationId in defaultConfig (works without flavors implementation)

Describe the bug

When using product flavors implementation, applicationId project.config.get("APP_ID") in defaultConfig is null.

Steps to Reproduce

  1. Follow product flavors installation instructions
  2. configure app/build.gradle like this:
project.ext.flavorEnvMapping = [
  dev: "../.env.staging.yaml",
  ...
]

...

defaultConfig {
  ...
  applicationId project.config.get("APP_ID")
}

buildTypes {
  ...
  debug { ... }
}

flavorDimensions "default"

    productFlavors {

      dev {
        dimension "default"
        ...
       }
    }
  1. Run react-native run-android --variant devDebug (or cd android; ./gradlew assembleDevDebug) to see build fail with
* What went wrong:
Execution failed for task ':app:processDevDebugGoogleServices'.
> No matching client found for package name <my_package_name> // because applicationId is 'null'

If I change to applicationId String.format("%s", project.config.get("APP_ID")) then it trows an error about how applicationId is null

  1. If I remove project.ext.flavorEnvMapping, run yarn rnuc env.staging.yaml, then run react-native run-android --variant devDebug (or cd android; ./gradlew assembleDevDebug), everything works perfectly without any other changes.

Expected behavior

I expect product flavors to work just the same as using the yarn rnuc cli

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

APP_ID: "com.my.application"

OS

  • ios
  • android

Packages

  • version of react-native: 0.64.2
  • version of react-native-ultimate-config: 3.4.1

Run react-native info and post below:

System:
    OS: macOS 11.5.2
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 490.96 MB / 32.00 GB
    Shell: 5.8 - /usr/local/bin/zsh
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
    Yarn: 3.0.2 - ~/.nvm/versions/node/v14.15.4/bin/yarn
    npm: 7.21.1 - ~/.nvm/versions/node/v14.15.4/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.2 - /Users/wkoutre/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
      Build Tools: 19.1.0, 20.0.0, 21.1.2, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3
      System Images: android-23 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7678000
    Xcode: 13.0/13A233 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.10 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.64.2 => 0.64.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Module UltimateConfig required main queue setup warning

image

Hey, I figured you've seen this before, it seems like all you need to do is drop in the 'requiredMainQueueSetup' somewhere?

I'm not very familiar with native-side stuff or I'd throw up a PR for you lol. I can try if you want me too.

Figured it'd be nice to eliminate this warning every time and avoid a future bug.

Url params encode

Hello! First of all, I'd like to say that I really appreciate you for such a great library!

Unfortunately, I've realized that there is some issue with string encoding.

After run yarn rnuc .env url params like app?= was transformed into ?app&#x3D.

Steps:

yarn run .env

Actual result

TEST=url?app= --- > TEST=url?app&#x3D

Expected result

TEST=url?app= --- > TEST=url?app=

Thank you!

Android flavors not compiling

Hi there,
XCode Schemes work great. But I'm now trying to get the Android flavors working but they aren't compiling.

android/app/build.gradle:

project.ext.flavorEnvMapping = [
    local: "../env.local.yaml"
]
android {
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    flavorDimensions "default"
    productFlavors {
       local {}
   }
}

I can then run:
yarn rnuc env.local.yaml
with no problem.

But then I get this:

cd android
./gradlew assembleLocalDebug

> Configure project :app
Flavor mapping detected: [local:../env.local.yaml]
Root config [local:APP_VERSION:1 FACEBOOK_APP_ID:12345]
processing variant localDebug
mapping exists

FAILURE: Build failed with an exception.

* Where:
Script '/Users/xxxxx/Dropbox/PROJECTS/AUPAIRED/RCT/xxxxx/node_modules/react-native-ultimate-config/android/rnuc.gradle' line: 44

* What went wrong:
A problem occurred configuring project ':app'.
> groovy.lang.MissingMethodException: No signature of method: rnuc_b2ienkmadhxj28kgl9iu86xug$_flattenConfig_closure3.doCall() is applicable for argument types: (String) values: [A]
  Possible solutions: doCall(java.lang.Object, java.lang.Object), findAll(), findAll(), isCase(java.lang.Object), isCase(java.lang.Object)

Any thoughts?

Thanks,

Pete

How to access from shell scripts

I'm migrating from react-native-config and trying to access some of the environment variables from a shell script after initiating the rnuc utility. I have this working like this which is an adjustment from how I had it working from react-native-config:

# Get current version from production env file
yarn rnuc .env.prod
set -o allexport; source ios/rnuc.xcconfig; set +o allexport
echo "Current version: ${APP_VERSION}"

But is there a better/simpler recommended way? I cant see it in the docs.

What does the rnuc utility write to the android project by the way? Whatever it is seems to disappear after running yarn so I've put a postinstall script in my package.json to run yarn rnuc .env - again if that's the best way perhaps it could be added to the readme.

Installation fails in React Native 0.62

When I run yarn android I got this.

> Configure project :app
No flavor mapping detected. Reading injected file
Root config [APP_NAME:KurirApp]
processing variant debug
mapping does not exist or flavor is not defined
config per flavor  [APP_NAME:KurirApp]
all keys [APP_NAME]
all keys as string APP_NAME
processing variant release
mapping does not exist or flavor is not defined
config per flavor  [APP_NAME:KurirApp]
all keys [APP_NAME]
all keys as string APP_NAME

> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.

> Task :app:mergeDexDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
226 actionable tasks: 4 executed, 222 up-to-date
D8: Cannot fit requested classes in a single dex file (# fields: 65656 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
	at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)
	at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
	at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:444)
	at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335)
	at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:50)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61)
	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:53)
	at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:217)
	at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:212)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
	at com.android.tools.r8.utils.t.a(:55)
	at com.android.tools.r8.D8.run(:11)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116)
	... 34 more
Caused by: com.android.tools.r8.utils.AbortException: Error: null, Cannot fit requested classes in a single dex file (# fields: 65656 > 65536)
	at com.android.tools.r8.utils.Reporter.a(:21)
	at com.android.tools.r8.utils.Reporter.a(:7)
	at com.android.tools.r8.dex.VirtualFile.a(:33)
	at com.android.tools.r8.dex.VirtualFile$h.a(:5)
	at com.android.tools.r8.dex.ApplicationWriter.a(:13)
	at com.android.tools.r8.dex.ApplicationWriter.write(:35)
	at com.android.tools.r8.D8.d(:44)
	at com.android.tools.r8.D8.b(:1)
	at com.android.tools.r8.utils.t.a(:23)
	... 36 more


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
     The number of method references in a .dex file cannot exceed 64K.
     Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
D8: Cannot fit requested classes in a single dex file (# fields: 65656 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
	at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)
	at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
	at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:444)
	at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335)
	at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:50)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61)
	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:53)
	at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:217)
	at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:212)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
	at com.android.tools.r8.utils.t.a(:55)
	at com.android.tools.r8.D8.run(:11)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116)
	... 34 more
Caused by: com.android.tools.r8.utils.AbortException: Error: null, Cannot fit requested classes in a single dex file (# fields: 65656 > 65536)
	at com.android.tools.r8.utils.Reporter.a(:21)
	at com.android.tools.r8.utils.Reporter.a(:7)
	at com.android.tools.r8.dex.VirtualFile.a(:33)
	at com.android.tools.r8.dex.VirtualFile$h.a(:5)
	at com.android.tools.r8.dex.ApplicationWriter.a(:13)
	at com.android.tools.r8.dex.ApplicationWriter.write(:35)
	at com.android.tools.r8.D8.d(:44)
	at com.android.tools.r8.D8.b(:1)
	at com.android.tools.r8.utils.t.a(:23)
	... 36 more


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
     The number of method references in a .dex file cannot exceed 64K.
     Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s

    at makeError (/Users/arry/Project/Coolfix/node_modules/execa/index.js:174:9)
    at /Users/arry/Project/Coolfix/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async runOnAllDevices (/Users/arry/Project/Coolfix/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
    at async Command.handleAction (/Users/arry/Project/Coolfix/node_modules/@react-native-community/cli/build/index.js:186:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

android/app/build.gradle

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-ultimate-config/android/rnuc.gradle"

MainApplication.java

  @Override
  public void onCreate() {
    super.onCreate();
    
    initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
    UltimateConfigModule.setBuildConfig(BuildConfig.class); 
  }

Replace values in string.xml

Is it posible to use .yaml values in string.xml.

For example:

  • env.yaml
CODEPUSH_KEY:
  android: "myAndroidKey"
  ios: "myiOSKey"
  • android/app/src/main/res/values/strings.xml
<resources>
    <string name="app_name">PanalDev</string>
    <string moduleConfig="true" name="CodePushDeploymentKey">${CODEPUSH_KEY}</string>
</resources>

I've tried it without success but maybe there is a trick to make it work

Thanks!

Great work

Build error on 0.71.2: 'RNUltimateConfigSpec.h' file not found

Hi,
I am having the next problem while building project with RN 0.71.2 (new architecture enabled ):

In file included from ..UltimateConfig.m:1:
..UltimateConfig.h:3:9: fatal error: 'RNUltimateConfigSpec.h' file not found

Ultimate Config Version: "6.0.0"

I didnt found this file in sources, so i suppose it was not generated.

initialize env from code ?

is there any way to initiate env file from code ? means we need to change env files based on user selection in testing.

Doesn't support quotes in strings

This library shows promise, but it doesn't support quoted strings.

e.g. my config file is:

HELLO: "Here is a test with a \"quote\" inside"

But in ConfigValues.h that gets compiled to:

#define HELLO @"Here is a test with a "quote" inside"

.. which fails to compile in XCode. Any chance of a workaround?

Cannot choose between the following variants of com.facebook.react:react-native:0.70.6:

Describe the bug

Android Studio can not build gradle with new version of React native

Steps to Reproduce

  • Init a new project with React Native latest version
  • Yarn add library react-native-ultimate-config with latest version
  • Go to android studio and sync gradle or build android
    => error:
    build.gradle ~../../node-modules/react-native-ultimate-config/android
    Cannot choose between the following variants of com.facebook.react:react-native:0.70.6: :line 113

Expected behavior

Build successful and no have error occurs

Stacktraces, logs, screenshots

Screen Shot 2023-01-02 at 22 14 49

Environment

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using YAML file as a source for variables

Example of env file that is causing problems

❗PROVIDE EXAMPLE OF ENV FILE
the same example in library instructions setting

OS

  • ios
  • android

Packages

  • version of react-native: ❗0.70.6
  • version of react-native-ultimate-config: ❗4.0.0
  • version of gradle: 7.2.1
  • distributionUrl=https://services.gradle.org/distributions/gradle-7.5.1-all.zip

Run react-native info and post below:

 Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
/Users/mac/Documents/Working/diagrammobile/node_modules/react-native-reanimated/android/react-native-reanimated-70-hermes.aar

> Configure project :react-native-ultimate-config
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/mac/Documents/Working/diagrammobile/node_modules/react-native-ultimate-config/android/build.gradle' line: 113

* What went wrong:
A problem occurred configuring project ':react-native-ultimate-config'.
> Could not resolve all files for configuration ':react-native-ultimate-config:implementation'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-ultimate-config
      > Cannot choose between the following variants of com.facebook.react:react-native:0.70.6:
          - debugVariantDefaultRuntimePublication
          - releaseVariantDefaultRuntimePublication
        All of them match the consumer attributes:
          - Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.6:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'debug' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Variant 'releaseVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.6:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'release' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/mac/Documents/Working/diagrammobile/node_modules/react-native-ultimate-config/android/build.gradle' line: 113

* What went wrong:
A problem occurred configuring project ':react-native-ultimate-config'.
> Could not resolve all files for configuration ':react-native-ultimate-config:implementation'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-ultimate-config
      > Cannot choose between the following variants of com.facebook.react:react-native:0.70.6:
          - debugVariantDefaultRuntimePublication
          - releaseVariantDefaultRuntimePublication
        All of them match the consumer attributes:
          - Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.6:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'debug' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Variant 'releaseVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.70.6:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'release' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s

    at makeError (/Users/mac/Documents/Working/diagrammobile/node_modules/execa/index.js:174:9)
    at /Users/mac/Documents/Working/diagrammobile/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/mac/Documents/Working/diagrammobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/mac/Documents/Working/diagrammobile/node_modules/@react-native-community/cli/build/index.js:142:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Let me know if you have any questions. I have a problem with this issues but I can not resolve this with new version react native.

Geting variables in android/build.gradle

Hello!
First of all, thanks for your work!

The question:
Is it possible to get value in android/build.gradle (not from android/app dir)? For now, I'm getting an error during build

> Could not get unknown property 'config' for root project '***' of type org.gradle.api.Project.

Thanks!

xcode error profile doesn't match the entitlements file's value for the application-identifier entitlement.

I must say RNUC is the easiest and neatest env config for React Native as right now. Thank you @maxkomarychev for this great package!

Everything works like a charm for me after closely following the instructions except XCode wouldn't treat my qa and prod env configs as different apps even though they have different bundle identifiers and display name. Whenever I switch the env, Xcode always tries to upgrade the previous install on the device and then with the failed installation error message: profile doesn't match the entitlements file's value for the application-identifier entitlement.

Android Configure error

I am getting following error when configuring the android project

Configure project :app
No flavor mapping detected. Reading injected file

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script '/Volumes/Data/OfficeProjects/DeliveryApp/node_modules/react-native-ultimate-config/android/rnuc.gradle' line: 30

  • What went wrong:
    A problem occurred evaluating script.

could not read object from /Volumes/Data/OfficeProjects/DeliveryApp/node_modules/react-native-ultimate-config/android/rnuc.yaml but got 'null'

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is

org.gradle.api.GradleScriptException: A problem occurred evaluating script.
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:237)
	at org.gradle.configuration.DefaultScriptTarget.addConfiguration(DefaultScriptTarget.java:74)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:242)
	at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)
	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)
	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:151)
	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:41)
	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:74)
	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:185)
	at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:49)
	at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:37)
	at org.gradle.api.Script$apply.callCurrent(Unknown Source)
	at build_9bbcuuurdoct7azgyycmxa7dx.run(/Volumes/Data/OfficeProjects/DeliveryApp/android/app/build.gradle:85)
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:237)
	at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:242)
	at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)
	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)
	at org.gradle.configuration.project.BuildScriptProcessor$1.run(BuildScriptProcessor.java:45)
	at org.gradle.internal.Factories$1.create(Factories.java:26)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:212)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:193)
	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
	at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:107)
	at org.gradle.internal.Factories$1.create(Factories.java:26)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:238)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:232)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:193)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:96)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:68)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:699)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:142)
	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:64)
	at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:61)
	at org.gradle.configuration.BuildOperatingFiringProjectsPreparer$ConfigureBuild.run(BuildOperatingFiringProjectsPreparer.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.BuildOperatingFiringProjectsPreparer.prepareProjects(BuildOperatingFiringProjectsPreparer.java:40)
	at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:204)
	at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:142)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:130)
	at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104)
	at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:70)
	at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:67)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:85)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:78)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:78)
	at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:67)
	at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:62)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:27)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.GradleException: could not read object from /Volumes/Data/OfficeProjects/DeliveryApp/node_modules/react-native-ultimate-config/android/rnuc.yaml but got 'null'
	at rnuc_9h7sp6uhgrdst8ta89iqcvles.readYaml(/Volumes/Data/OfficeProjects/DeliveryApp/node_modules/react-native-ultimate-config/android/rnuc.gradle:30)
	at rnuc_9h7sp6uhgrdst8ta89iqcvles$readYaml.callCurrent(Unknown Source)
	at rnuc_9h7sp6uhgrdst8ta89iqcvles.buildRootConfig(/Volumes/Data/OfficeProjects/DeliveryApp/node_modules/react-native-ultimate-config/android/rnuc.gradle:48)
	at rnuc_9h7sp6uhgrdst8ta89iqcvles.run(/Volumes/Data/OfficeProjects/DeliveryApp/node_modules/react-native-ultimate-config/android/rnuc.gradle:74)
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
	... 154 more

==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
	at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:80)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:73)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.access$600(LifecycleProjectEvaluator.java:53)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:109)
	at org.gradle.internal.Factories$1.create(Factories.java:26)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:238)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:232)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:193)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:96)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:68)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:699)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:142)
	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:64)
	at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:61)
	at org.gradle.configuration.BuildOperatingFiringProjectsPreparer$ConfigureBuild.run(BuildOperatingFiringProjectsPreparer.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.BuildOperatingFiringProjectsPreparer.prepareProjects(BuildOperatingFiringProjectsPreparer.java:40)
	at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:204)
	at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:142)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:130)
	at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104)
	at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:70)
	at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:67)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:85)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:78)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:78)
	at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:67)
	at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:62)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:27)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: compileSdkVersion is not specified.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:507)
	at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:655)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:82)
	at com.android.build.gradle.BasePlugin.lambda$createTasks$5(BasePlugin.java:615)
	at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt:37)
	at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt)
	at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1.lambda$run$0(DefaultListenerBuildOperationDecorator.java:152)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.reapply(DefaultUserCodeApplicationContext.java:60)
	at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1.run(DefaultListenerBuildOperationDecorator.java:152)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction.execute(DefaultListenerBuildOperationDecorator.java:149)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:92)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:231)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:150)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:325)
	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:235)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy35.afterEvaluate(Unknown Source)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:191)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:188)
	at org.gradle.api.internal.project.DefaultProject.stepEvaluationListener(DefaultProject.java:1434)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:197)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:112)
	... 110 more

==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

CONFIGURE FAILED in 4s

Error while running in AppCenter

  • Where:
    Script '/Users/runner/work/1/s/node_modules/react-native-ultimate-config/android/rnuc.gradle' line: 17

  • What went wrong:
    A problem occurred evaluating script.

yaml file at path /Users/runner/work/1/s/node_modules/react-native-ultimate-config/android/rnuc.yaml does not exist

I think it could not find any yaml file in root, instead of android folder. How can I resolve this? @maxkomarychev @sdenaci @irohitb, thanks for incredible lib, hope you give me a solution to fix this

Null is not an object in iOS

Hi and thanks for the good work.
I'm unable to get it working on iOS, is working fine on Android.
I've followed all the steps but whatever I try I get null is not an object each time I need access to configuration variable.

Do you've any idea/trick to try?
Best,
Leo

`null is not an object (evaluating '_env.default.API_BASE_URL')

create
Api.js:39:30

index.js:39:64
loadModuleImplementation
require.js:303:6

index.js:4
loadModuleImplementation
require.js:303:6

App.js:6
loadModuleImplementation
require.js:303:6

index.js:8
loadModuleImplementation
require.js:303:6
guardedLoadModule
require.js:195:45
`

Flavor mapping fails on app center build

Describe the bug

Flavor mapping on appcenter build fails with file not found but works well locally

Steps to Reproduce

set up flavor mapping according to cook book (yaml file exists in repo)

project.ext.flavorEnvMapping = [
    dev: "../.env.yaml",
    staging: "../.env.staging.yaml"
]

Expected behavior

Expected Flavor mapping to be success full on appcenter (works locally)

Stacktraces, logs, screenshots

FAILURE: Build failed with an exception.

* Where:
Script '/Users/runner/runners/2.171.1/work/1/s/node_modules/react-native-ultimate-config/android/rnuc.gradle' line: 17

* What went wrong:
A problem occurred evaluating script.
> /Users/runner/runners/2.171.1/work/1/s/../.env.yaml (No such file or directory)

Environment

macos-10.15

Integration option

  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)

OS

  • android

Packages

  • version of react-native: 0.62.2
  • version of react-native-ultimate-config: ^3.1.4

Additional context

build works fine locally

'config' is null on Android

Describe the bug

Application on Android crashes while running.
Everything is ok on iOS

Steps to Reproduce

  1. yarn rnuc .env
  2. react-native run-android

The bundle is built but the app crashes with error:

TypeError: Cannot read property 'NATIVE_CLIENT_URL' of null, js engine: hermes

Code:

import config from 'react-native-ultimate-config';

new NativeApiService(config.NATIVE_CLIENT_URL);

Expected behavior

The app shouldn't crash.

Stacktraces, logs, screenshots

Environment

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

ENVIRONMENT=development

NATIVE_CLIENT_URL=http://my-url

OS

  • ios
  • android

Packages

  • version of react-native: 0.63.1
  • version of react-native-ultimate-config: 3.2.3
    Run react-native info and post below:
System:
    OS: macOS 10.15
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 1.72 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.12.0 - /usr/local/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 23.0.1, 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-22 | Google APIs Intel x86 Atom_64, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_181 - /usr/bin/javac
    Python: 2.7.15 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.1 => 0.63.1 
  npmGlobalPackages:
    *react-native*: Not Found

Additional context

Add any other context about the problem here.

3.4.0 doesn't support React 17

Upgraded to React Native 0.65.1 today and it requires React 17.0.2, but RNUC doesn't support it.

Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.1" from [email protected]
npm ERR! node_modules/react-native-ultimate-config
npm ERR! react-native-ultimate-config@"*" from the root project

Should I use the -- force option to force the dependency conflict?

is it possible to keep env based package name in proguard-rules.pro?

In an app that I'm currently working on, there is a requirement to keep different package names for different branches, for e.g (com.xyz.master in master branch and com.xyz.staging in the staging branch), but to allow this amazing library to work with proguard we need to hardcode the Bundle ID. I'd be grateful if it someone could point me in the right direction to set up this library for my scenario.

Any help is greatly appreciated!

Web support

It would be a killer feature if this package worked on the web as well (for universal react-native/react-native-web projects). It can almost be used as is with the js_override flag set to true, except that the getter functions in the resulting override.js file don't have branches for the web platform.

The bare minimum that would be needed to support this:

  • Add web branches to the auto-generated RN.Platform.select calls in override.js.
  • Add a web key along side the ios and android keys in platform-specific yaml config.
  • Add typescript definitions for override.js.
  • Document that js_override must be turned on and "react-native-ultimate-config/override" imported directly to work on the web (to avoid importing the native module).

A semi-related suggestion: why not drop the js_override flag and the UltimateConfig module reference from JavaScript entirely and just generate a pure JavaScript module containing the needed variables. This would simplify usage (zero config!) and make things work on the web and on native with the same import path. Or am I missing some benefit to pulling the JS config values from native?

If you're open to one or more of these ideas I'm happy to create a pull request.

iOS - Implicit declaration of function getValues is invalid in C99

Describe the bug

Error when building ios from xcode

Steps to Reproduce

in xcode click product -> build

Expected behavior

sucess building iOS

Stacktraces, logs, screenshots

Post stacktraces, logs or screenshots. The more information is available
is better.

Environment

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

APP_HOST=<link_url>
APP_STORAGE_TAG=<@tag>

AUTODETECT_LOCATION=true
ENABLE_CUSTOM_URL=false
ENABLE_FEATURE_APPLEPAY=true
ENABLE_FEATURE_ONESIGNAL=true

ANDROID_APP_NAME=<app_name>
ANDROID_VERSION_NAME=1.0.0
ANDROID_VERSION_CODE=13
ANDROID_URL=<link_url>

IOS_APP_NAME=<app_name>
IOS_VERSION_NAME=1.0.0
IOS_VERSION_CODE=13
IOS_URL=<link_url>

DISCOVERY_SERVICE_URL=<link_url>

SENTRY_DSN=<link_url>

WEBVIEW_LANG=en-ae,ar-sa,id-id
WEBVIEW_USERAGENT=Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.96 Mobile Safari/537.36

DEEPLINK_TAG_APPLEPAY=APPLEPAY
DEEPLINK_TAG_TELEMEDICINE=VIDEO_URL
DEEPLINK_HOST_TELEMEDICINE=teleconference

ONESIGNAL_APP_ID=<app_id>

OS

  • ios
  • android

Packages

  • version of react-native: 0.62.2
  • version of react-native-ultimate-config: ^1.2.5

Run react-native info and post below:

System:
    OS: macOS 11.2
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 219.96 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 15.4.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.0.15 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      Android NDK: 22.0.7026061
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.3/12C33 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

[UPDATE]

Additional context

error screenshot

Screen Shot 2021-02-02 at 10 35 52

Could not find a declaration file for module 'react-native-ultimate-config'

Describe the bug

I'm using latest "react-native-ultimate-config": "^3.2.3" via Yarn, with React Native 0.63 + TypeScript 3.9.7 project. And I'm getting the following error when I import it.

Could not find a declaration file for module 'react-native-ultimate-config'. 'xxxx/node_modules/react-native-ultimate-config/index.js' implicitly has an 'any' type. Try npm install @types/react-native-ultimate-configif it exists or add a new declaration (.d.ts) file containingdeclare module 'react-native-ultimate-config'`

Expected behavior

As per documentation the type definitions should already be there.

Error React Native IOS Undefined symbol: _RCTRegisterModule

Error React Native IOS Undefined symbol: _RCTRegisterModule in Build react-native-ultimate-config

I changed de s.dependency "React" to s.dependency "React-Core but still not working
I can't find the solution

React Native version: "0.68.5"
Ultimate Config Version: "4.0.0"

Values only accessable in debug mode (without flavors)????

My .env file

APPLICATION_ID=my_app_id_here
NAME=app_name_here

then i run this command:
yarn rnuc .env

Then in my react-native app i access the values as:

import config from 'react-native-ultimate-config'

config.NAME // access it here

But these values are only accessable in debug mode

In release mode its undefined??????

v3.0.0 - v3.3.1 Android cannot load url in webview

Describe the bug

I just upgraded lib to the latest version, v3.3.1. Then i run yarn rnuc .env, but it cannot load webview url, always return error. I try to install all lib version, only v2.2.0 that can run url in webview.

Steps to Reproduce

  1. create webview react native project
  2. create env file with values, for example: ANDROID_URL=https://google.com
  3. run yarn rnuc .env

Expected behavior

load that url in webview

Stacktraces, logs, screenshots

error [TypeError: Network request failed]
Screen Shot 2021-03-23 at 11 42 26

Environment

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

ANDROID_URL=https://google.com

OS

  • ios -> working well
  • android

Packages

  • version of react-native: 0.62.2
  • version of react-native-ultimate-config: ^3.3.1

Run react-native info and post below:

System:
    OS: macOS 11.3
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 41.53 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.6.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.6.3 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

Additional context

Add any other context about the problem here.

Build Failure - RN 0.69.1

Describe the bug

Configure project :react-native-ultimate-config
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/nikhilpatel/ovs-projects/Bitbucket/yourzone-frontend/node_modules/react-native-ultimate-config/android/build.gradle' line: 113

  • What went wrong:
    A problem occurred configuring project ':react-native-ultimate-config'.

Could not resolve all files for configuration ':react-native-ultimate-config:implementation'.
Could not resolve com.facebook.react:react-native:+.
Required by:
project :react-native-ultimate-config
> Cannot choose between the following variants of com.facebook.react:react-native:0.69.1:
- debugVariantDefaultRuntimePublication
- releaseVariantDefaultRuntimePublication
All of them match the consumer attributes:
- Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.69.1:
- Unmatched attributes:
- Provides com.android.build.api.attributes.BuildTypeAttr 'debug' but the consumer didn't ask for it
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
- Variant 'releaseVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.69.1:
- Unmatched attributes:
- Provides com.android.build.api.attributes.BuildTypeAttr 'release' but the consumer didn't ask for it
- Provides org.gradle.category 'library' but the consumer didn't ask for it
- Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
- Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
- Provides org.gradle.status 'release' but the consumer didn't ask for it
- Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

Steps to Reproduce

Steps to reproduce the behavior.

Build Android project using RN 0.69.1

Expected behavior

Project Builds successfully

Stacktraces, logs, screenshots

Post stacktraces, logs or screenshots. The more information is available
is better.

Environment

See reactnative.dev for RN 0.69.1

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

❗PROVIDE EXAMPLE OF ENV FILE

OS

  • ios
  • android

Packages

  • version of react-native: ❗ INSERT VERSION HERE
  • version of react-native-ultimate-config: ❗INSERT VERSION HERE

Run react-native info and post below:

PASTE OUTPUT OF `react-native info` HERE

Additional context

Add any other context about the problem here.

Warning on build: ios/rnuc.xcconfig: line 1: //: is a directory

Getting this warning/error on a production build in the console:

ios/rnuc.xcconfig: line 1: //: is a directory

It's because the first line of the file written to the ios folder contains a comment:

// DO NOT COMMIT OR EDIT THIS FILE
VARIANT=CCF
APP_VERSION=1.0.77
APP_BUILD=958
BUILD=Production

Can anything be done about this?

Is part of README redundant?

In the docs it says these files will be updated:

android/src/main/java/com/reactnativeultimateconfig/ConfigValues.java
ios/ConfigValues.h

but they don't seem to exist in my project and yet the config seems to work fine. Is this part of the README now redundant?

Vulnerable dependency

Describe the bug

SAST scanning of our app detected vulnerable dependency:

Description: `handlebars` before 4.7.7 are vulnerable to Remote Code Execution (RCE) when selecting certain compiling options to compile templates coming from an untrusted source.

OS

  • ios
  • android

Packages

  • version of react-native: 0.64.2
  • version of react-native-ultimate-config: 3.2.3

Additional context

It's critical for us since we can't move to PROD with this issue.

Jest: Mock the library react-native-ultimate-config

One of the files has (translation setup) imports the RNUC. And the selection of the right translations is heavily relies on .env variables. During the runtime, it resolves properly:

import config from 'react-native-ultimate-config';

console.log('--- config --- ', config);

// output
// --- config ---  {
// APP_NAME: "fooBar",
// BUNDLE_ID: "com.foo.bar
// ....
// }

But if I run the test

yarn jest app/component/Component.test.tsx

the output is

--- config ---  {}

That means I need to mock the library somehow, and I did not found the proper instructions in README

Please guide me on how to implement that.

Thank you a lot

@isilher @maxkomarychev

How is it different from react-native-config?

Congratz on your project.

I think it would save newcomers some precious research time if you could include some information in the README on how it differs from luggit/react-native-config and the potential benefits of switching over for projects that already use that other solution.

Support reload on JS recompile

The killer feature of react-native-dotenv was to quickly change the .env file and reload the JS app to catch up on the changes.
This seems not to be possible with this library and react-native-config.
I understand the reasons, cause the ENV vars are also made available in native code, but couldn't the option be added to refresh the JS on the fly?

Native apps are using web configuration

Describe the bug

Native apps always use the variables from index.web.js, rather than the native variables, even if js_override is not set.

Steps to Reproduce

  • Create two environments, .env.development with APP_NAME=Development and .env.production with APP_NAME=Production
  • Create a simple app which shows the app's name in a <Text> component
  • Build and run the development app: yarn rnuc .env.development && yarn android
  • Note the text component shows Development
  • Run yarn rnuc .env.production
  • Note the text hot reloads and now shows Production

Editing the config in node_modules/react-native-ultimate-config/index.web.js will also cause the text to change, showing that the native app is taking the value from here, instead of from the native configuration.

Expected behavior

The environment variables should only change when a new native build is done.

Environment

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

APP_NAME=Development

OS

  • ios
  • android

Packages

  • version of react-native: ❗ 0.65.1
  • version of react-native-ultimate-config: ❗3.4.1

Additional context

Metro, the React Native bundler, prefers browser to main entries in package.json, meaning that a native app will always take react-native-ultimate-config's index.web.js file. However, it supports a react-native key, which takes priority over both of these (see https://github.com/facebook/metro/blob/7e99d9eb673469f88d0c03544f4533b4f56f75f9/packages/metro/src/ModuleGraph/node-haste/Package.js#L108-L116 for the implementation of that).

I think the fix should be quite simple, just adding one line to the package.json:

"react-native": "index.js",

I will create a PR for this, but I have never used react-native-web before, so I don't know if its bundler will prefer a browser or react-native entry in the package.json. I presume it would choose browser, but I don't know for sure.

R8 fails due to Generics in ProGuard Rules

Describe the bug

When building the app for release, it fails with the following error message:

> Task :app:transformClassesAndResourcesWithR8ForDevdefaultshRelease FAILED
/Users/runner/work/1/s/android/app/proguard-rules.pro:67:25: R8: Use of generics not allowed for java type.

This is because of the ProGuard rule mentioned in the quickstart guide:

-keepclassmembers class <APPLICATION ID>.BuildConfig {
   public static <fields>;
}

I could fix it by replacing <APPLICATION ID>.BuildConfig with the import path of the BuildConfig as it is in MainApplication.java.

Steps to Reproduce

  1. Setup the Project with ProGuard and RNUC as in the Guide
  2. Build the Project for Release:
npm run rnuc config/falvor/env.dev && cross-env BUILD_TARGET=flavor ./android/gradlew -p android clean :app:assembleFlavorRelease
  1. It will fail

Expected behavior

It should build the app successfully.

Stacktraces, logs, screenshots

> Task :app:transformClassesAndResourcesWithR8ForDevdefaultshRelease FAILED
/Users/runner/work/1/s/android/app/proguard-rules.pro:67:25: R8: Use of generics not allowed for java type.

Environment

Integration option

  • I am using rnuc CLI to inject environment (default integration option
    from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration
    option from cookbook:
    scheme,
    flavors)
  • I am using react-native-ultimate-config within monorepo managed with
    Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

Irrelevant

OS

  • ios
  • android

Packages

  • version of react-native: 0.63.2
  • version of react-native-ultimate-config: ^3.2.4

Run react-native info and post below:

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 885.38 MB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.18.4 - ~/.nvm/versions/node/v12.18.4/bin/node
    Yarn: Not Found
    npm: 6.14.6 - ~/.nvm/versions/node/v12.18.4/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 26, 27, 28, 29, 30
      Build Tools: 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.1, 30.0.2
      System Images: android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom_64
      Android NDK: 17.2.4988734
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.7 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Wrong types definition

I'm using React Native with TypeScript. So, after :

import config from 'react-native-ultimate-config'

I tried to use config and got ts error:

'config' only refers to a type, but is being used as a value here.

So I'd like to propose you instead of generating index.d.ts file like:

// DO NOT COMMIT OR EDIT THIS FILE
declare module 'react-native-ultimate-config' {
    export interface ConfigVariables {
        TEST: string
    }
    export default ConfigVariables;
}

Do:

// DO NOT COMMIT OR EDIT THIS FILE
interface ConfigVariables {
   TEST: string
}

declare const UltimateConfig: ConfigVariables

export default UltimateConfig

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.