stovmascript / react-native-version

:1234: Version your React Native or Expo app in a `npm version` fashion.
MIT License
579 stars 75 forks source link

TypeError [ERR_INVALID_ARG_TYPE] #66

Open ocarreterom opened 6 years ago

ocarreterom commented 6 years ago

I have this error running: react-native-version

[RNV] Versioning Android...
[RNV] Android updated
[RNV] Versioning iOS...
[RNV] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
Usage: react-native-version [options] [projectPath]

React Native Info

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
      Memory: 18.00 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.9.0 - /usr/local/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.2.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 25.0.0, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3
        API Levels: 23, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.0 => 0.57.0
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
loiclouvet commented 6 years ago

Same issue here, @ocarreterom did you resolve it ?

stovmascript commented 6 years ago

How are you executing react-native-version? Is it installed globally, or are you running it from the project? Furthermore, can you provide a sample or an idea of your project directory structure?

VPelt commented 3 years ago

problem is this function returns undefined (as wel as the right filename)

function getPlistFilenames(xcode) {
    return unique(
        flattenDeep(
            xcode.document.projects.map(project => {
                return project.targets.filter(Boolean).map(target => {
                    return target.buildConfigurationsList.buildConfigurations.map(
                        config => {
                            return config.ast.value.get("buildSettings").get("INFOPLIST_FILE")
                                .text;
                        }
                    );
                });
            })
        )
    );
}
chetstone commented 4 months ago

I ran into this after adding a watch target to my project. Some of the resulting build configs don't have INFOPLIST_FILE entries (instead they have GENERATE_INFOPLIST_FILE = YES; for some reason).