Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.config.js reportedly not a full replacement for app.json #2193

Closed
Nantris opened this issue Jan 21, 2024 · 2 comments
Closed

app.config.js reportedly not a full replacement for app.json #2193

Nantris opened this issue Jan 21, 2024 · 2 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@Nantris
Copy link

Nantris commented Jan 21, 2024

Build/Submit details page URL

No response

Summary

According to this popular issue, useFrameworks: 'static' cannot be used in app.config.js like it can in app.json.

I haven't tried to replicate this finding because we absolutely require an app.config.js, but thus far a hundred other things I've tried have not resolved the issue reported in that thread, and so I have to imagine the problem is our use of app.config.js instead of app.json.

Can this discrepancy be addressed?

Managed or bare?

Managed

Environment

  expo-env-info 1.2.0 environment info:
    System:
      OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
      Shell: 5.9 - /usr/bin/zsh
    Binaries:
      Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
      Yarn: 1.22.21 - ~/.nvm/versions/node/v20.11.0/bin/yarn
      npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
      Watchman: 4.9.0 - /usr/bin/watchman
    SDKs:
      Android SDK:
        API Levels: 31, 32
        Build Tools: 30.0.3, 31.0.0, 33.0.0, 33.0.1, 34.0.0
        System Images: android-31 | Google APIs Intel x86_64 Atom, android-31 | Google Play Intel x86 Atom_64
    npmPackages:
      expo: ~49.0.21 => 49.0.21 
      react-native: ~0.72.5 => 0.72.6 
    npmGlobalPackages:
      eas-cli: 7.0.0
      expo-cli: 6.3.10
    Expo Workflow: managed

NOTE: Reported expo-doctor errors have been occurring for the past 6-7 SDK versions and are due to some error on the Expo or its handling of monorepos, not our code. The requiring packages for the flagged problems are the recommended versions of expo packages for our SDK version, eg [email protected]

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check npm/ yarn versions
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✖ Check that native modules use compatible support package versions for installed Expo SDK

Detailed check results:

Expected package @expo/config-plugins@~7.2.2
Found invalid:
@expo/[email protected]
(for more info, run: npm why @expo/config-plugins)
Expected package @expo/metro-config@~0.10.0
Found invalid:
@expo/[email protected]
(for more info, run: npm why @expo/metro-config)
Advice: Upgrade dependencies that are using the invalid package versions.

One or more checks failed, indicating possible issues with the project.

Error output


❌  (../../node_modules/react-native/ReactCommon/cxxreact/Instance.cpp:24:10)

  22 | #include <folly/MoveWrapper.h>
  23 | #include <folly/json.h>
> 24 | #include <react/debug/react_native_assert.h>
     |          ^ 'react/debug/react_native_assert.h' file not found
  25 | 
  26 | #include <glog/logging.h>
  27 | 
› Compiling react-native Pods/React-cxxreact » CxxNativeModule.cpp
› Compiling react-native Pods/React-cxxreact » cxxreact_vers.c
⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » ourproject/ourproject » Build Phases » 'Start Packager'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » ourproject/ourproject » Build Phases » 'Bundle React Native code and images'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » ourproject/ourproject » Build Phases » '[CP-User] [RNFB] Core Configuration'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
▸ ** BUILD FAILED **
▸ The following build commands failed:
▸   CompileC /Users/expo/workingdir/build/packages/mobile/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-cxxreact.build/Objects-normal/x86_64/Instance.o /Users/expo/workingdir/build/node_modules/react-native/ReactCommon/cxxreact/Instance.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-cxxreact' from project 'Pods')
▸ (1 failure)
2024-01-20 16:07:37.517 xcodebuild[4297:14424] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
** BUILD FAILED **
The following build commands failed:
  CompileC /Users/expo/workingdir/build/packages/mobile/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-cxxreact.build/Objects-normal/x86_64/Instance.o /Users/expo/workingdir/build/node_modules/react-native/ReactCommon/cxxreact/Instance.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-cxxreact' from project 'Pods')
(1 failure)
Exit status: 65

Reproducible demo or steps to reproduce from a blank project

N/A

@Nantris Nantris added the needs review Issue is ready to be reviewed by a maintainer label Jan 21, 2024
@Nantris
Copy link
Author

Nantris commented Jan 21, 2024

@brentvatne @szdziedzic could you possibly advise on this issue? I examined the code starting from these lines but couldn't identify any reason this might be the case: https://github.com/expo/expo/blob/57989fd8cc89ea3a9797603d9b5fe6295bc70405/packages/%40expo/config/src/Config.ts#L218-L236

I have already tried (probably) every other solution anyone has ever suggested on the internet.

I don't know if modifyConfigAsync may play a role. It does say: This will only fully work if the project is using static configs only. - but I've never seen the warning it notes would be produced if this was the problem.

@brentvatne
Copy link
Member

According to this invertase/react-native-firebase#6332 (comment), useFrameworks: 'static' cannot be used in app.config.js like it can in app.json.

you can indeed use it with app.config.js. both app.json / app.config.js are evaluated with the npx expo config --type public command, so if the result is the same in both cases you can use whichever config format you like.

the only limitation of the dynamic config is that we can't safely modify the config file itself automatically (eg: to add an eas project id) so we instead tell you what to add to your file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants