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

[🐛] config IDs when using app.config.js/app.config.ts rather than app.json #462

Closed
1 task done
megacherry opened this issue Sep 28, 2023 · 15 comments
Closed
1 task done
Labels
help wanted Extra attention is needed

Comments

@megacherry
Copy link
Contributor

What happened?

First of all: sorry if any information or similar is missing. I try my best :)

I'm writing because I currently switched from app.json to app.config.js/app.config.ts (I use expo). Mainly to serve different environments.

Then when I went to rebuild my project, I got an error: "error: ios_app_id key not found in react-native-google-mobile-ads key in app.json. App will crash without it."

Then I searched for related issues and found the following issue: #370

But that doesn't help me because firstly the issue is closed and secondly the pull request is only for Android (and not merged). I currently have the problems on iOS.

I then looked at what it fails and found that a parsing of Javascript Object Literal Syntax is not so trivial. Especially something like this: "process.env.APP_NAME || 'myapp'".

So I came up with the following solution (ios_config.sh):

  • Search additionally for app.config.js/app.config.ts.
  • If found, then try to parse an additional file "admob-config.json" on the corresponding keys

I patched the ios_config.sh locally. But that would be only the part for iOS. If the solution sounds good, then we have to adjust the readme and think of something for Android as well.

How can I best help you at this point?

Platforms

Android and iOS

React Native Info

System:
  OS: macOS 13.6
  CPU: (8) arm64 Apple M1
  Memory: 91.02 MB / 16.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 20.7.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 3.6.1
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.1.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.09.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.0
    path: /Users/andreas.kirsch/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "28"
      - "30"
      - "31"
      - "32"
      - "33"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
    System Images:
      - android-30 | Google Play ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9514443
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.8.1
    path: /opt/homebrew/bin/javac
  Ruby:
    version: 3.0.2
    path: /Users/andreas.kirsch/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Are your using Typescript?

  • My project is using Typescript

package.json

not relevant at this point

app.json

not relevant at this point

the template title should be changed to "app.json/app.config.js/app.config.ts" :)

ios/Podfile

No response

android/build.gradle

No response

android/app/build.gradle

No response

android/settings.gradle

No response

AndroidManifest.xml

No response

@megacherry megacherry added the help wanted Extra attention is needed label Sep 28, 2023
@robgraeber
Copy link

+1

Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added stale and removed stale labels Nov 10, 2023
@MorvanL

This comment was marked as resolved.

1 similar comment
@manarbenkraouda
Copy link

+1

@mikehardy
Copy link
Collaborator

I believe reasonable PRs are merged here - if you post a PR we can discuss, and there seems to be a lot of interest from the +1 brigade posting copycat comments, so perhaps we'll have people willing to do more than post a +1 and they'll test it and give us confidence it works prior to merge...

@MorvanL

This comment was marked as resolved.

@mikehardy

This comment was marked as resolved.

@mikehardy

This comment was marked as resolved.

@MorvanL

This comment was marked as resolved.

@MorvanL

This comment was marked as resolved.

@megacherry
Copy link
Contributor Author

hi @mikehardy, thanks for your answer. but unfortunately I cannot push PRs. iOS is fixed, have to write documentation and for android i need help from other supporters.

@mikehardy
Copy link
Collaborator

@megacherry I am not sure why you can't do PRs? I believe all you need to do is fork the repo, do the work on a branch then make a PR? It is a fork-based repo

Copy link

github-actions bot commented Jan 1, 2024

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@megacherry
Copy link
Contributor Author

@mikehardy: The PR is created. Took me some time because it's my first PR on GitHub. :)

@github-actions github-actions bot removed the stale label Jan 2, 2024
@dylancom
Copy link
Collaborator

dylancom commented Jan 9, 2024

Solved by #517

@dylancom dylancom closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants