Giter Club home page Giter Club logo

react-native-schemes-manager's Introduction

React Native Schemes Manager

โš ๏ธ This package is no longer necessary since react-native version 0.60 or above. React Native now supports the schemes correctly without any workaround.

Now you can use Xcode build configurations / schemes with React Native without pulling your hair out.

Build Status

If your app has multiple environments, you'd probably like to be able to manage these the way native developers have been doing for years, Xcode schemes and build configurations.

By default, React Native doesn't handle these particularly well, and the ability to launch dev tools or run in debug mode is impacted. This package fixes these problems.

Made by Kevin Brown, supported by Tech Insite. Thank you for making this project possible!

Installation

yarn add --dev react-native-schemes-manager

or

npm install --save-dev react-native-schemes-manager

Once the package is installed in your project, you just need to configure it by adding an xcodeSchemes section to your package.json and adding a postinstall script which will re-run the script whenever you add or remove packages to/from your project:

{
	"name": "your-awesome-app",
	"version": "1.0.0",
	"scripts": {
		"postinstall": "react-native-schemes-manager all"
	},
	"xcodeSchemes": {
		"Debug": ["Staging", "Preflight"],
		"Release": ["Beta"],
		"projectDirectory": "iOS",
		"settings": {
			"fix-script": {
				// Additional environment variables your code might need
				// They will be set using an `export` right before the scheme manager script runs.
				"env": {
					"NODE_BINARY": "/usr/bin/node6",
					"LOGGING_LEVEL": "4"
				},
				// If you need to use some other command to run the scheme manager script
				// (for example, if you use a library like Sentry).
				"nodeCommand": "$NODE_BINARY ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode"
			}
		}
	},
}

This configuration will copy the "Debug" build configuration to the "Staging" and "Preflight" build configurations in all your dependent library projects. This configuration will also copy the "Release" build configuration to the "Beta" build configuration for all of the dependent libraries. The "Debug" and "Release" arrays are both optional.

If your Xcode project is not in the default directory, "ios", you can specify the directory using the optional projectDirectory configuration. The above configuration specifies that the project is in an "iOS" directory instead (directories are case sensitive).

You can also pass in settings for each command. The only one currently supported is fix-script.

What Then?

The package is able to do three things:

  • Swap its own version of react-native-xcode.sh in instead of the stock one that assumes all debug schemes are named 'Debug'.
  • Add your build configurations to all library Xcode projects.
  • Hide any schemes that come from your library projects so they don't show up in the menu.

As long as react-native-schemes-manager all has run whenever you add react native modules, you should be good to go.

It's not working!

A good starting point for troubleshooting is:

  • Completely quit Xcode.
  • rm -rf node_modules
  • yarn or npm i
  • Re open Xcode
  • Product -> Clean
  • Run

If you're still having trouble, post an issue so we can look into it.

Running Manually

You can run the three parts of this package on demand by running either:

  • react-native-schemes-manager fix-libraries: Adds your build configurations to all library Xcode projects.
  • Specify the --single-project parameter to fix a single Xcode project. Example: --single-project=React
  • react-native-schemes-manager fix-script: Swaps a schemes aware build script in instead of the stock react native one.
  • react-native-schemes-manager hide-library-schemes: Hides any build schemes that come from your node_modules folder xcodeproj files as you don't usually want to see them anyway.

And of course you can run all 3 easily if you'd prefer:

  • react-native-schemes-manager all: Runs all the scripts above.

The best way to give yourself a manual trigger for this is add to your package.json scripts section like so:

{
	"name": "your-awesome-app",
	"version": "1.0.0",
	"scripts": {
		"fix-xcode": "react-native-schemes-manager all",
		"postinstall": "react-native-schemes-manager all"
	}
}

You can then yarn run fix-xcode or npm run fix-xcode which will run the cleanup scripts on demand.

Uninstalling

If you decide this isn't working out for you, we'd love to know why and to try to fix it. Please open an issue.

But if you still want to get rid of this and revert the changes to your project, you can follow these steps:

  1. yarn remove react-native-schemes-manager or npm remove react-native-schemes-manager --save-dev
  2. Open your Xcode project.
  3. Click on the project itself on the left sidebar to ensure it's selected.
  4. Click the "Build Phases" tab.
  5. Expand the "Bundle React Native code and images" phase.
  6. Change the script to:
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh

Then, you can revert the changes to the installed libraries by:

  1. Quitting Xcode.
  2. rm -rf node_modules
  3. yarn or npm i
  4. Re-open Xcode.

You're back to where you started!

Further Reading

These are some great articles about related topics in case you're hungry for more:

License

Licensed under the MIT License, Copyright ยฉ 2017 Kevin Brown.

See LICENSE for more information.

Acknowledgements

This project builds on a lot of earlier work by clever folks all around the world. We'd like to thank Alek Hurst and Craig Edwards who contributed ideas and inspiration, without which this project wouldn't have been possible.

react-native-schemes-manager's People

Contributors

alanfoster avatar brandonsmith avatar corymsmith avatar davidstoker avatar dependabot[bot] avatar gabceb avatar gwmccull avatar kamal avatar matthieulemoine avatar pierpo avatar thekevinbrown avatar titozzz avatar tmaly1980 avatar tylerhou avatar yenbekbay 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

react-native-schemes-manager's Issues

hide-library-schemes breaks Sentry CLI

Steps to reproduce the behavior

Have this as "Bundle React native code and images" script in your React-Native build phases:

export DEVELOPMENT_BUILD_CONFIGURATIONS="+(Debug)"
export NODE_BINARY=node
export SENTRY_PROPERTIES=./sentry.properties

$NODE_BINARY ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh

Expected behavior

Release should be created in the appropriate Sentry project, with main.jsbundle and main.jsbundle.map files uploaded.

Actual behavior

Release is not created, and no files are ever uploaded.

Notes

So, I was moving stuff around in the build script, and noticed that removing these two lines:

cd "$SCHEMES_MANAGER_DIR/../.."
$NODE_BINARY "$SCHEMES_MANAGER_DIR/index.js" hide-library-schemes

actually fixes the issue! :)

Also, it does not have any ill effects to the work of this package itself...

Link error /Build/Products/Debug-iphonesimulator file not found

Steps to reproduce the behavior

Just followed the steps at given article
https://medium.com/@ywongcode/building-multiple-versions-of-a-react-native-app-4361252ddde5

Selected Beta Scheme and tried to build

Expected behavior

Build should be successful and app should be installed in simulator

Actual behavior

Getting below error

Ld /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/PlugIns/SampleExampleTests.xctest/SampleExampleTests normal x86_64
    cd /Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk -L/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator -L/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/SampleExampleTests -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/AWSCore -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/AWSIoT -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/Analytics -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/Charts -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/GoogleToolboxForMac -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/HandyJSON -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/Protobuf -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/ReachabilitySwift -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SwiftyJSON -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/iBChatiOS -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/nanopb -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseCore/Frameworks -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseMessaging/Frameworks -F/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -filelist /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/Objects-normal/x86_64/SampleExampleTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -bundle_loader /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/SampleExample -Xlinker -object_path_lto -Xlinker /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/Objects-normal/x86_64/SampleExampleTests_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -framework XCTest -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/SampleExampleTests.xctest.xcent /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/libReact.a -framework Pods_SampleExampleTests -Xlinker -dependency_info -Xlinker /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/Objects-normal/x86_64/SampleExampleTests_dependency_info.dat -o /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/PlugIns/SampleExampleTests.xctest/SampleExampleTests

ld: file not found: /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/SampleExample
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Not skipping the bundle step on Debug configuration

Steps to reproduce the behavior

We installed react-native-schemes-manager by following this tutorial . When we build a Debug configuration, the react native packager is running steps that should be only for Release configuration like bundling the JS in one file, therefore making the build longer.

It seems like this script (react-native-xcode.sh) is not able to recognize whether it is Debug or Release configuration, and therefore not skipping the bundling part.

Info:

  • React Native version: 0.44.3
  • react-native-schemes-manager npm version: 1.0.0
  • package.json
 "xcodeSchemes": {
    "Debug": [
      "App1.Debug",
      "App2.Debug"
    ],
    "Release": [
      "App1.Release",
      "App2.Release"
    ],
    "projectDirectory": "ios"
  }
  • command:
react-native run-ios --scheme App1 --configuration App1.Debug

Expected behavior

Should skip JavaScript bundling while in Debug configuration

Actual behavior

JavaScript bundling:

(...)
bundle: start

bundle: finish
bundle: Writing bundle output to: /Users/me/Dev/mobile-apps-consumer/ios/build/Build/Products/App1.Debug-iphonesimulator/App1.app/main.jsbundle

bundle: Done writing bundle output

bundle: Copying 7 asset files

bundle: Done copying assets

+ [[ ! -n false ]]



PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks build/Build/Intermediates/mobileAppsConsumer.build/App1.Debug-iphonesimulator/mobileAppsConsumer.build/Script-364AF5F6FE9FE68F0A32E715A6885D4E.sh
    cd /Users/me/Dev/mobile-apps-consumer/ios
    /bin/sh -c /Users/me/Dev/mobile-apps-consumer/ios/build/Build/Intermediates/mobileAppsConsumer.build/App1.Debug-iphonesimulator/mobileAppsConsumer.build/Script-364AF5F6FE9FE68F0A32E715A6885D4E.sh

mkdir -p /Users/me/Dev/mobile-apps-consumer/ios/build/Build/Products/App1.Debug-iphonesimulator/App1.app/Frameworks

rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/me/Dev/mobile-apps-consumer/ios/build/Build/Products/App1.Debug-iphonesimulator/GoogleToolboxForMac/GoogleToolboxForMac.framework" "/Users/me/Dev/mobile-apps-consumer/ios/build/Build/Products/App1.Debug-iphonesimulator/App1.app/Frameworks"

building file list ... done
(...)

PS: thanks for this awesome library, it really saved us a lot of time.

Archiving a config named something other than 'Release' e.g. 'Release-Staging'

Is it possible to archive a config other than Release? I've been stuck for days now trying to do this. I can run and build any config fine, and I can archive Release, but can't archive anything else. I get this error: facebook/react-native#11813

I tried all the troubleshooting steps of this package, plus all of the suggestions in that thread but they don't seem to work. Then in this comment it says 'We were not able to build an archive from a different build config. Run is no problem. Since we use BuddyBuild and only require our release version to be build for archive (to be able to upload to itunes), this did not bother us.'

So I was wondering, is it actually impossible? And if it isn't, can it be added in?

Failed to install version 1.0.2

Steps to reproduce the behavior

Set version to 1.0.2, run npm install

Expected behavior

react-native-schemes-manager installs to node_modules

Actual behavior

Fails with error:

.../node_modules/react-native-schemes-manager/src/fix-script.js:20
			const scriptSettings = mappings.settings['fix-script'] || {};
			                                        ^

TypeError: Cannot read property 'fix-script' of undefined

Production releases contain dev javascript bundles

Steps to reproduce the behavior

Build a production version of the react-native application, and output the value of __DEV__

Expected behavior

The value of __DEV__ is set to false, and all dev tools are removed - i.e. prop type warnings etc.

Actual behavior

The value of __DEV__ is set to true, even though it is a production build.

Reason

The current dynamic case statement has syntax issues:

Showing All Issues
../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh: eval: line 88: syntax error near unexpected token `)'
../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh: eval: line 88: `  )'

Subsequently the status code is ignored, meaning $DEV is not set.
When $DEV is not set, the default bundling mechanism for react-native is true.

Therefore when using this plugin and requesting a production build, we are still given the dev build.

I'll put a PR up for this

After upgrading to react-native 0.60.x schemes other than production (default) do not work.

Steps to reproduce the behavior

  1. Upgrade to react-native 0.60.x
  2. Adapt code & configuration of packages to conform with auto-linking, etc.
  3. Run the ios version of the app using a configured scheme

Expected behavior

The app should install and run with the defines scheme

Actual behavior

When using cli (i.e. react-native run-ios --scheme \"TheSampleApp-Development\" --configuration Debug.Development) the command compiles successfully, the app is installed but opens with a blank black screen (after showing the splash screen) on the simulator.

On the other hand when using xcode to build the development scheme, the app again installs and runs, reaches the splash screen and after that we get a white blank screen. In xcode the output is the following:

2019-07-22 21:02:18.412065+0300 TheSampleApp[22447:687268] Attempted to override non-null API key with nil - ignoring.
WARN : BSG_KSCrashSentry.c (109): BSG_KSCrashType bsg_kscrashsentry_installWithContext(BSG_KSCrash_SentryContext *, BSG_KSCrashType, void (*)(char, char *)): KSCrash: App is running in a debugger. Only user reported events will be handled.
2019-07-22 21:02:18.451 [fatal][tid:main] No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.
2019-07-22 21:02:18.451125+0300 TheSampleApp[22447:687268] No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.
2019-07-22 21:02:18.467287+0300 TheSampleApp[22447:687268] *** Terminating app due to uncaught exception 'RCTFatalException: No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.', reason: 'No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001072d96fb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x00000001053aaac5 objc_exception_throw + 48
	2   TheSampleApp             0x0000000101f860dc RCTGetFatalHandler + 0
	3   TheSampleApp             0x0000000101f9e39e __28-[RCTCxxBridge handleError:]_block_invoke + 685
	4   libdispatch.dylib                   0x0000000109835d7f _dispatch_call_block_and_release + 12
	5   libdispatch.dylib                   0x0000000109836db5 _dispatch_client_callout + 8
	6   libdispatch.dylib                   0x0000000109844080 _dispatch_main_queue_callback_4CF + 1540
	7   CoreFoundation                      0x00000001072408a9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	8   CoreFoundation                      0x000000010723af56 __CFRunLoopRun + 2310
	9   CoreFoundation                      0x000000010723a302 CFRunLoopRunSpecific + 626
	10  GraphicsServices                    0x000000010d52a2fe GSEventRunModal + 65
	11  UIKitCore                           0x0000000110edaba2 UIApplicationMain + 140
	12  TheSampleApp             0x0000000101e752a0 main + 112
	13  libdyld.dylib                       0x00000001098ab541 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

The bundler is already running separately in both occasions via yarn start as for some reason it stopped running automatically after/during building the app.

Cannot read property 'Symbol(Symbol.iterator)' of undefined during react-native-schemes-manager all

I've been trying to use the react-native-schemes-manager all with my xcodeSchemes set to

"xcodeSchemes": {
    "Debug": [
      "DebugStaging"
    ]
  }

I'm running node 7.10.0 and using "react-native-schemes-manager": "^1.0.0-beta.8", but keep getting the error

> react-native-schemes-manager all && (cd ios && pod install) && npm run check:node

Hiding schemes from node_modules xcode projects.
ios/live2leave.xcodeproj
 - [fix-script]: ios/live2leave.xcodeproj skipped
 โœ” [fix-libraries]: Debug -> DebugStaging created in node_modules/react-native-branch/ios/RNBranch.xcodeproj
/Users/johngill/Workspace/live2leave-mobile/node_modules/react-native-schemes-manager/src/fix-libraries.js:33
		for (const destinationBuildConfig of mappings[sourceBuildConfig]) {
		                                             ^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
    at updateProject (/Users/johngill/Workspace/live2leave-mobile/node_modules/react-native-schemes-manager/src/fix-libraries.js:33:48)
    at utilities.updateProjectsMatchingGlob (/Users/johngill/Workspace/live2leave-mobile/node_modules/react-native-schemes-manager/src/fix-libraries.js:82:10)
    at getFilesMatchingGlob (/Users/johngill/Workspace/live2leave-mobile/node_modules/react-native-schemes-manager/src/utilities.js:70:8)
    at glob (/Users/johngill/Workspace/live2leave-mobile/node_modules/react-native-schemes-manager/src/utilities.js:45:5)
    at f (/Users/johngill/Workspace/live2leave-mobile/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/Users/johngill/Workspace/live2leave-mobile/node_modules/glob/glob.js:151:7)
    at emitOne (events.js:96:13)
    at Glob.emit (events.js:191:7)
    at Glob._finish (/Users/johngill/Workspace/live2leave-mobile/node_modules/glob/glob.js:199:8)
    at done (/Users/johngill/Workspace/live2leave-mobile/node_modules/glob/glob.js:184:14)

Any thoughts you have would be appreciated

Configuration names with spaces causes react-native-xcode.sh to error out.

Steps to reproduce the behavior

1.) Create a configuration named Staging Debug and add to package.json entry.
2.) Run fix-xcode script and fix-libraries.
3.) Build and run app

Expected behavior

No errors when running script

Actual behavior

Receiving error messages like this in the XCode build log and the rest of the script fails so the app doesn't get set up correctly to use the xip IP addresses and will only load from the pre-packaged bundle.

../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh: eval: line 37: syntax error near unexpected token `Debug'
../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh: eval: line 37: `  Staging Debug|Debug)'

It's due to how this is being eval'ed here: https://github.com/Thinkmill/react-native-schemes-manager/blob/master/lib/react-native-xcode.sh#L17 so maybe we have to escape with double quotes?

critical npm install issue

npm install


> [email protected] postinstall /Users/xx/node_modules/react-native-schemes-manager
> node index.js verify-config

Options:
  -h, --help  Show help                                                [boolean]

Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/xx/.nvm/versions/node/v4.2.1/bin/node" "/Users/xx/.nvm/versions/node/v4.2.1/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node index.js verify-config`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'node index.js verify-config'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-native-schemes-manager package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index.js verify-config
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-native-schemes-manager
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-native-schemes-manager
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xx/npm-debug.log


---- npm-debug.log

1578 verbose stack Error: [email protected] postinstall: `node index.js verify-config`
1578 verbose stack Exit status 1
1578 verbose stack     at EventEmitter.<anonymous> (/Users/xx/.nvm/versions/node/v4.2.1/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
1578 verbose stack     at emitTwo (events.js:87:13)
1578 verbose stack     at EventEmitter.emit (events.js:172:7)
1578 verbose stack     at ChildProcess.<anonymous> (/Users/xx/.nvm/versions/node/v4.2.1/lib/node_modules/npm/lib/utils/spawn.js:40:14)
1578 verbose stack     at emitTwo (events.js:87:13)
1578 verbose stack     at ChildProcess.emit (events.js:172:7)
1578 verbose stack     at maybeClose (internal/child_process.js:818:16)
1578 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
1579 verbose pkgid [email protected]
1580 verbose cwd /Users/xx
1581 error Darwin 16.1.0
1582 error argv "/Users/xx/.nvm/versions/node/v4.2.1/bin/node" "/Users/xx/.nvm/versions/node/v4.2.1/bin/npm" "install"
1583 error node v4.2.1
1584 error npm  v3.10.6
1585 error code ELIFECYCLE
1586 error [email protected] postinstall: `node index.js verify-config`
1586 error Exit status 1
1587 error Failed at the [email protected] postinstall script 'node index.js verify-config'.
1587 error Make sure you have the latest version of node.js and npm installed.
1587 error If you do, this is most likely a problem with the react-native-schemes-manager package,
1587 error not with npm itself.
1587 error Tell the author that this fails on your system:
1587 error     node index.js verify-config
1587 error You can get information on how to open an issue for this project with:
1587 error     npm bugs react-native-schemes-manager
1587 error Or if that isn't available, you can get their info via:
1587 error     npm owner ls react-native-schemes-manager
1587 error There is likely additional logging output above.
1588 verbose exit [ 1, true ]


ld: 843 duplicate symbols for architecture x86_64 error

I'm cracking my head over getting schemes to work on my project. I use Cocoapods for some libraries and regular npm install for others.

My pod file:
target 'project' do
pod 'RSKImageCropper'
pod 'QBImagePickerController'
pod 'Fabric'
pod 'Crashlytics'

target 'projectTests' do
  inherit! :search_paths
  # Pods for testing
end

end

My xcodeSchemes:
"xcodeSchemes": {
"Debug": ["xDebug"],
"Release": ["xRelease", "xStaging", "Staging"],
"projectDirectory": "ios",
"settings": {
}
},

Steps to reproduce the behavior

Make the base project/scheme work first, then execute npm run postinstall, then try to run in another scheme.

Build error in xcode:

duplicate symbol _OBJC_IVAR_$_RCTCxxMethod._method in:
    /Users/x/ios/Build/Products/xDebug-iphonesimulator/libReact.a(RCTCxxMethod.o)
    /Users/x/ios/Build/Products/Debug-iphonesimulator/libReact.a(RCTCxxMethod.o)
duplicate symbol _OBJC_CLASS_$_RCTCxxMethod in:
    /Users/x/ios/Build/Products/xDebug-iphonesimulator/libReact.a(RCTCxxMethod.o)
    /Users/x/ios/Build/Products/Debug-iphonesimulator/libReact.a(RCTCxxMethod.o)
....

    /Users/x/ios/Build/Products/Debug-iphonesimulator/libReact.a(RCTModalManager.o)
duplicate symbol _OBJC_METACLASS_$_RCTModalManager in:
    /Users/x/ios/Build/Products/xDebug-iphonesimulator/libReact.a(RCTModalManager.o)
    /Users/x/ios/Build/Products/Debug-iphonesimulator/libReact.a(RCTModalManager.o)
ld: 843 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I try to run from a scheme in the release configuration (xStaging), I get a slightly different error:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from: objc-class-ref in libReact.a(RCTPackagerConnection.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior

Should be able to run/build in the various schemes.

Actual behavior

New scheme is using old code bundle

I'm in the process of upgrading our app to RN42 and I came across the issue with custom schemes.

The scheme I'm trying to make is called, Qa. If I create a Qa scheme on each of the libraries that I'm importing, the app compiles and runs with all schemes.

If I use react-native-schemes-manager to create the Qa scheme, the Qa scheme is created in each library (as expected), and the app will compile for all schemes.

The app will run the latest JavaScript for the Debug and Release schemes but when I try to run the app in the simulator using the Qa scheme, it ends up using an old code bundle.

I bundle my code using:

react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ios-release/main.jsbundle

If I run the Qa scheme, I have to manually re-bundle the code after each code change.

If I'm not using react-native-schemes-manager and I just create the Qa schemes manually, it picks up the latest code changes whenever I tell xcode to start the app.

I added some debugging to the node_modules/react-native-schemes-manager/lib/react-native-xcode.sh` script and I get the following inputs:

DEST=/Users/gmccullough/Library/Developer/Xcode/DerivedData/BuildApp-cznvdybssjczggcpafgzxrjrvgyj/Build/Products/Qa-iphonesimulator/BuildApp.app
DEVELOPMENT_BUILD_CONFIGURATIONS=Qa|Debug
CONFIGURATION=Qa
PLATFORM_NAME=iphonesimulator
Debug build!
Skipping bundling for Simulator platform

How can I make it not skip the bundling phase?

Looking around the project & target settings I only see one thing that is significantly different for the Qa scheme:

  • the target has some Preprocessor Macros set up in the Build Settings
    • the Qa scheme is set to $(inherited) QA=1. This makes for a total inherited value of DEBUG=1 COCOAPODS=1 QA=1

Environment:
node: 6.2.2
NPM: 3.9.5
project root folder: BuildApp
iOS project folder: BuildApp/iOS

let me know what other information you need.

Thanks for the help!

Steps to reproduce the behavior

Install per recommended instructions
Run app using Qa scheme

Expected behavior

App will run with latest code

Actual behavior

App runs with old code

Trying to debug on ios device, CONFIGURATION is always Release

Just as the title says, I am trying to create a debug build on a physical device, however no matter what, $CONFIGURATION always is Release

Edit: Now that I double checked, it is always release when building on the simulator as well.

Steps to reproduce the behavior

  1. Create several Debug configurations
  2. Try to run on ios device

Expected behavior

Be able to have the app run in dev mode and debug on physical device

Actual behavior

App is configured as a production build

Expected [\n\r] but end of input found

Quite an odd issue, but it seems that this package gives an error for any project.pbxproj which doesn't have a new line at the end of the file.

Steps to reproduce the behavior

  • Remove the new line from the end of any related project.pbxproj file
  • Run react-native-schemes-manager

Expected behavior

Runs ok

Actual behavior

Receives error:
Expected [\n\r] but end of input found

Current fix

--- submitting PR as we speak

Wrong scheme when running from CLI

First of all, thank you so much for this amazing library, it's a life saver!

Steps to reproduce the behavior

Run the project on the command line. react-native run-ios --scheme beta

Expected behavior

Should run project using beta scheme

Actual behavior

Always runs the original Debug scheme

Additional notes

Running via XCode works fine

Version 2.0.0 changelog

Hey,

I'm just curious to find the version 2 changelog. I have an outdated version (1.0.5) of the package being used on my repo, and I would like to upgrade, but I couldn't find the changelog. Is there any place where I can find it?

Release build crashes on RN 0.49+

Awesome work on the library!

Steps to reproduce the behavior

  • RN49+
  • Setup as usual

Expected behavior

Release build should not crash

Actual behavior

Release build crashes on launch

React Native 0.49 changes the JS entry point of RN App
So we have single index.js instead of separate index.android.js and index.ios.js

This breaks the generated scripts since it expects index.ios.js as the entry point.

The fix would be to add index.js on the generated build phase script
screen shot 2018-02-28 at 11 33 37 am

Would be great if this is documented somewhere ๐Ÿ‘

Javascript Heap Error on modules with circular links

The react native schemes manager chokes loops out of control when it encounters circular symlinks within a node module.

Steps to reproduce the behavior

Install a node module with a circular link, such as react-native-http, which contains the obvious circular link:
react-native-http/example/get/node_modules/http-browserify/example/streaming/node_modules/http-browserify -> ../../..

Run react-native-schemes-manager all

Expected behavior

Script completes without error.

Actual behavior

Script meets untimely demise.

Hiding schemes from node_modules xcode projects.
iOS/XXXXXX.xcodeproj
 - [fix-script]: iOS/XXXXXX.xcodeproj skipped

<--- Last few GCs --->

[68345:0x103801e00]   151252 ms: Mark-sweep 1493.3 (1572.4) -> 1493.2 (1541.4) MB, 1981.5 / 0.7 ms  last resort GC in old space requested
[68345:0x103801e00]   153191 ms: Mark-sweep 1493.2 (1541.4) -> 1493.2 (1541.4) MB, 1938.3 / 0.4 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x13bb3fca58b9 <JSObject>
    1: _readdirEntries [/Users/XXXXXX/Projects/XXXXXX/XXXXXX/XXXXXX/node_modules/glob/glob.js:~559] [pc=0x70da8a28c7e](this=0x13bb3ad956f9 <Glob map = 0x13bbc89233b9>,abs=0x13bbfb9844f1 <String[392]: /Users/XXXXXX/Projects/XXXXXX/XXXXXX/XXXXXX/node_modules/react-native-http/example/get/node_modules/http-browserify/example/streaming/node_modules/http-browse...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Does this work for different targets?

Steps to reproduce the behavior

Seems like when I duplicate a target (different app store for a whitelabel) it still wants to go debug even though its a release on the archive.

Expected behavior

It should be release on archive - my architectures are correct in the build settings

Actual behavior

Debug instead of release

Script overrides React Native Run script

When you run react-native-schemes-manager all it will override Bundle React Native code and images. But the problem is that if I have something custom there for example export DISABLE_XIP=true it will override that also.

image

So the solution would be that it does not just replace the whole script but append stuff this library needs to add ๐Ÿ‘

library not found for -lBVLinearGradient

Hi,
when build or archive i get this error:

library not found for -lBVLinearGradient

Info

React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 47.29 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.1 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.58.3 => 0.58.3
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-git-upgrade: 0.2.7
react-native: 0.56.0

Steps to reproduce the behavior

Expected behavior

Actual behavior

Support also fixing the cocoapods generated project.pbxproj

Steps to reproduce the behavior

Install you cocoapod dependencies, which generates the file ios/Pods/Pods.xcodeproj/project.pbxproj (because you add React and other dependencies via cocoapods).

Run react-native-schemes-manager all.

Expected behavior

The ios/Pods/Pods.xcodeproj/project.pbxproj project file is also fixed and should have the right preprocessor macro variables.

Actual behavior

The ios/Pods/Pods.xcodeproj/project.pbxproj project file is missing the DEBUG variable.

screen shot 2018-03-04 at 22 37 51

Make it optional to skip 'Pods.xcodeproj'?

I'm wondering about this part in the utilities.js

if (filePath.endsWith(path.join('Pods.xcodeproj', 'project.pbxproj'))) {
  // The Pods.xcodeproj file isn't currently able to be parsed
  // by node-xcode:
  // https://github.com/alunny/node-xcode/issues/127
  //
  // We don't actually need to manipulate it so we'll go ahead and ignore.
  return;
 }

In my project I have a dependency on https://github.com/tlenclos/react-native-audio-streaming which has a Pods.xcodeproj which also needs to have my staging configurations copied.

If I remove the section above from utilities.js everything works for me, so I'm wondering if perhaps there could be an option when running the script whether to run this check or not, or if it is even needed any more?

Steps to reproduce the behavior

Expected behavior

Actual behavior

Pulling wrong package from npm

Steps to reproduce the behavior

yarn add react-native-schemes-manager:
Screenshot 2019-04-02 at 08 30 42

Expected behavior

yarn to pull the latest code from github repo

Actual behavior

yarn pulls from a different, outdated repo, as demonstrated in the package.json:
Screenshot 2019-04-02 at 08 33 53

Incorrectly trying to determine the IP

There seems to be a problem with evaling the code here. One of my colleagues had his WiFi set up on en1, so the first line there was not returning.
The fallback using ifconfig does not work because the awk parameters are tried to resolved in the original context (the ' escape the code from the eval from what I can tell).

I'm mostly curious as to why eval is being used in the first place.

Steps to reproduce the behavior

  • don't have en0 on your machine (you should probably have an en1, or something)
  • run react-native run-ios (or whatever your relevant command is)

Expected behavior

  • you should get an IP, and a xip should work correctly.

Actual behavior

IP ends up being empty

Configuration with no Debug schemes causes a failure in react-native-xcode.sh

Steps to reproduce the behavior

add a package.json with:

{
  "xcodeScheme: {
    "Release": [ "Beta" ]
  }
}

will generate the following in Xcode:
```bash
export NODE_BINARY=node
export DEVELOPMENT_BUILD_CONFIGURATIONS="|Debug"
../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh

The leading bar | causes an error to be thrown by react-native-xcode.sh

Expected behavior

the export shouldn't have the leading bar |

react-native-scheme-manager post install script modifies getDevToolsMiddleware.js

Steps to reproduce the behavior

I am seeing this behavior with react-native 0.50.0 and up react-native. When I run my post install script:
{
"postinstall": "react-native-schemes-manager fix-libraries && react-native-schemes-manager fix-script",
}
node_modules/react-native/local-cli/server/middleware/getDevToolsMiddleware.js gets modified with possibly an invalid patch that breaks the build.

Expected behavior

getDevToolsMiddleware is not modified or modified correctly.

Actual behavior

getDevToolsMiddleware looks like this (notice the patch end near the middle of the file):

/* react-native-debugger-patch start */
var __opn = require('opn');
var __fs = require('fs');
var __path = require('path');
var __net = require('net');
var __childProcess = require('child_process');
var __home_env = process.platform === 'win32' ? 'USERPROFILE' : 'HOME';
var __port_file = __path.join(process.env[__home_env], '.rndebugger_port');

function __connectToRND(rndPath, log, cb) {
var __port;
try {
__port = __fs.readFileSync(__port_file, 'utf-8');
} catch (e) {
log && console.log(
'\n[RNDebugger] The port file $HOME/.rndebugger_port not found\n' +
'Maybe the React Native Debugger (^0.3) is not open?\n' +
'(Please visit https://github.com/jhen0409/react-native-debugger#installation)\n'
);
return cb(false);
}
var __c = __net.createConnection({ port: __port }, () => {
let pass = false;
__c.setEncoding('utf-8');
__c.write(JSON.stringify({ path: rndPath }));
__c.on('data', data => {
pass = data === 'success';
__c.end();
});
const __timeoutId = setTimeout(() => {
log && console.log(
'\n[RNDebugger] Cannot connect to port ' + __port + '.\n'
);
__c.end();
}, 1000);
__c.on('end', () => {
clearTimeout(__timeoutId);
log && console.log(
'\n[RNDebugger] Try to set port of React Native server failed.\n'
);
cb(pass);
});

});
}

var __rndebuggerIsOpening = false;
function launchChromeDevTools(port, skipRNDebugger) {
var __rnd_path = 'rndebugger://set-debugger-loc?host=localhost&port=' + port;

if (__rndebuggerIsOpening) return;
__rndebuggerIsOpening = true;
if (process.platform === 'darwin' && !skipRNDebugger) {
var __env = Object.assign({}, process.env);
// This env is specified from Expo (and CRNA), we need avoid it included in rndebugger
delete __env.ELECTRON_RUN_AS_NODE;
__childProcess
.spawn('open', ['-g', '-a', 'React Native Debugger', __rnd_path], { env: __env })
.once('close', code => {
if (code > 0) {
__connectToRND(__rnd_path, false, pass => {
if (!pass) {
console.log(
'\n[RNDebugger] Cannot open the app, maybe not install?\n' +
'(Please visit https://github.com/jhen0409/react-native-debugger#installation)\n' +
'Or it's never started. (Not registered URI Scheme)\n'
);
}
__rndebuggerIsOpening = false;
!pass && launchChromeDevTools(port, true);
});
} else {
__rndebuggerIsOpening = false;
}
})
return;
} else if (!skipRNDebugger) {
__connectToRND(__rnd_path, true, pass => {
__rndebuggerIsOpening = false;
!pass && launchChromeDevTools(port, true);
});
return;
}
__rndebuggerIsOpening = false;
/* react-native-debugger-patch end */
acebook, Inc.

  • All rights reserved.
  • This source code is licensed under the BSD-style license found in the
  • LICENSE file in the root directory of this source tree. An additional grant
  • of patent rights can be found in the PATENTS file in the same directory.
  • @Format
    */
    'use strict';

const launchChrome = require('../util/launchChrome');

const {exec} = require('child_process');

function launchChromeDevTools(port, args = '') {
var debuggerURL = 'http://localhost:' + port + '/debugger-ui' + args;
console.log('Launching Dev Tools...');
launchChrome(debuggerURL);
}

function escapePath(pathname) {
// " Can escape paths with spaces in OS X, Windows, and *nix
return '"' + pathname + '"';
}

function launchDevTools(
{port, projectRoots, useDeltaBundler},
isChromeConnected,
) {
// Explicit config always wins
var customDebugger = process.env.REACT_DEBUGGER;
if (customDebugger) {
var projects = projectRoots.map(escapePath).join(' ');
var command = customDebugger + ' ' + projects;
console.log('Starting custom debugger by executing: ' + command);
exec(command, function(error, stdout, stderr) {
if (error !== null) {
console.log('Error while starting custom debugger: ' + error);
}
});
} else if (!isChromeConnected()) {
// Dev tools are not yet open; we need to open a session
launchChromeDevTools(port, useDeltaBundler ? '#useDeltaBundler' : '');
}
}

module.exports = function(options, isChromeConnected) {
return function(req, res, next) {
if (req.url === '/launch-safari-devtools') {
// TODO: remove console.log and dev tools binary
console.log(
'We removed support for Safari dev-tools. ' +
'If you still need this, please let us know.',
);
} else if (req.url === '/launch-chrome-devtools') {
// TODO: Remove this case in the future
console.log(
'The method /launch-chrome-devtools is deprecated. You are ' +
' probably using an application created with an older CLI with the ' +
' packager of a newer CLI. Please upgrade your application: ' +
'https://facebook.github.io/react-native/docs/upgrading.html',
);
launchDevTools(options, isChromeConnected);
res.end('OK');
} else if (req.url === '/launch-js-devtools') {
launchDevTools(options, isChromeConnected);
res.end('OK');
} else {
next();
}
};
};

linker command failed with exit code 1 --- directory not found for option '.....[configuration_name]_iphonesimulator/xxx'

Steps to reproduce the behavior

First thank you for your work on this nice library.

My package.json has added the following:

  ...
  "scripts": {
    ......
    "postinstall": "react-native-schemes-manager all"
  },
  "xcodeSchemes": {
    "Debug": [
      "StagingDebug"
    ],
    "Release": [
      "StagingRelease"
    ],
    "projectDirectory": "ios",
    "settings": {}
  },
  ...

After editing the package.json I duplicated the configuration Debug and Release on my Xcode workspace. I also duplicated the scheme, pointed it to StagingDebug and made sure it is with build options Parallelize Build unchecked, and React is on the top of the build target list. And I run npm run postinstall.

Expected behavior

It should work. I tried to go though the same steps on a clean project "AwesomeProject" created by react-native init AwesomeProject and everything works like a charm.

I think it may because of react-native-config that I used in this project.

Actual behavior

Only able to build the old scheme with old configration. Fail to build the scheme with new configuration. The error is as screenshot below. And some libraries' folders are not generated in StagingDebug-iphonesimulator

screen shot 2019-03-01 at 2 29 36 pm

Can't open developer menu with new scheme

I am able to build and run my new scheme using react-native-schemes-manager, but I am not able to open up the react native debug menu using command + D or reloading using command + R.

I was wondering if it was because I am using cocoapods, but using this solution did not solve my issue.

Also, I've checked and made sure that the simulator is set to use the hardware keyboard.

The preprocessor macros for my new scheme on both my project and the Pods project have DEBUG=1.

What else am I missing?

Postinstall completes, but it has no effect

Steps to reproduce the behavior

I have 3 different Schemes with the associated Build Configurations:
Production: Release, Debug
Sandbox: Sandbox Release, Sandbox Debug
Dev: Dev Release, Dev Debug

Added the following to my package.json:

  "scripts": {
    "postinstall": "react-native-schemes-manager all"
  },
  "xcodeSchemes": {
    "Debug": [
      "Dev Debug",
      "Sandbox Debug"
    ],
    "Release": [
      "Release"
    ],
    "projectDirectory": "ios"
  }

When running npm install, the postinstall script runs fine and produces the following:

Hiding schemes from node_modules xcode projects.
ios/ProjectName.xcodeproj
 - [fix-script]: ios/ProjectName.xcodeproj skipped
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/ART/ART.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/ART/ART.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/ART/ART.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Image/RCTImage.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Image/RCTImage.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Image/RCTImage.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/RCTTest/RCTTest.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/RCTTest/RCTTest.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/RCTTest/RCTTest.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Sample/Sample.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Sample/Sample.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Sample/Sample.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Text/RCTText.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Text/RCTText.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Text/RCTText.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/React/React.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/React/React.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/React/React.xcodeproj
 โœ” [fix-libraries]: Debug -> Dev Debug created in node_modules/react-native/React/ReactLegacy.xcodeproj
 โœ” [fix-libraries]: Debug -> Sandbox Debug created in node_modules/react-native/React/ReactLegacy.xcodeproj
 - [fix-libraries]: Release -> Release skipped in node_modules/react-native/React/ReactLegacy.xcodeproj

Expected behavior

Running my app in Xcode with either the Sandbox or Dev Schemes (which use Sandbox Debug and Dev Debug build configurations) would be able to access react natives dev tools.

Actual behavior

I don't have access to the dev tools with those schemes. Only when I build with "Production" scheme from Xcode does it provide me with dev tools. I can't do development with our production endpoints for obvious reasons.

Thanks for the help here!

Configuration names with a space in them causes the fix-libraries script to break all libraries

Steps to reproduce the behavior

  • Create a configuration named Staging Release
  • Run the script for this library

Expected behavior

  • You should be able to open the project files for the libraries

Actual behavior

The project files won't open due to a parsing error. The configuration names need to be wrapped in quotes. They currently show up in the .pbxproj like so:

name = Staging Release;

when it should be
name = "Staging Release";

hide-library-schemes has no effect

Environment
Xcode 10.1
Node v8.15.0 (via NVM 0.33.5)
macOS Mojave
10.14.2 (18C54)

Steps to reproduce the behavior

run react-native-schemes-manager hide-library-schemes
see output

Expected behavior

run react-native-schemes-manager hide-library-schemes
see less library schemes

Actual behavior

bildschirmfoto 2019-02-08 um 11 27 46

No option to pass in a config script for the bundler

Steps to reproduce the behavior

react-native-xcode.sh from react-native allows passing in a configuration script for the metro bundler as follows:

export BUNDLE_CONFIG=<path to rn-cli-config.js>

Expected behavior

Developer should be able to specify a bundler configuration script.

Actual behavior

No option available.

Lexical or Preprocessor issue

Steps to reproduce the behavior

This is my package config (We use Sentry so I had to do this):

"xcodeSchemes": {
    "Debug": [
      "DebugCustomer"
    ],
    "Release": [
      "ReleaseCustomer"
    ],
    "projectDirectory": "ios",
    "settings": {
      "fix-script": {
        "nodeCommand": "export SENTRY_PROPERTIES=sentry.properties; $NODE_BINARY ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode"
      }
    }
  }

I have created two configurations for a customer that are a copy of Debug and Release. Then one scheme pointing to those configs. If I try to run the regular projects all runs fine, but the new one fails as if the package it is not doing what it is supposed to.

I am running the postinstall script manually yet the error is still there. Even after cleaning up the project and restarting xCode.

One thing I noticed is that sometimes if I run the script multiple times it would say that it is adding configurations to some packages like it could ot modified them at first.

Expected behavior

Project -> Run works as expected and I can load the build

Actual behavior

Project does not compile.

RNMail Group
Lexical or Preprocessor Issue Group
/XXXXX/node_modules/react-native-mail/RNMail/RNMail.h:2:9: 'React/RCTBridgeModule.h' file not found
XXXXX/node_modules/react-native-mail/RNMail/RNMail.m:2:9: In file included from /XXXXX/node_modules/react-native-mail/RNMail/RNMail.m:2:
RNStoreReview Group
Lexical or Preprocessor Issue Group
/XXXX/node_modules/react-native/React/Base/RCTBridgeModule.h:10:9: 'React/RCTDefines.h' file not found
/XXXX/node_modules/react-native-store-review/ios/RNStoreReview.m:1:9: In file included from /XXXX/node_modules/react-native-store-review/ios/RNStoreReview.m:1:
/XXXXX/node_modules/react-native-store-review/ios/RNStoreReview.h:2:9: In file included from /XXXX/node_modules/react-native-store-review/ios/RNStoreReview.h:2:

Using RN 0.55.4 and RNSM 1.0.5.

[fix-script]: Error! RangeError: Maximum call stack size exceeded

Steps to reproduce the behavior

upgrade to react-native 0.51

Expected behavior

script still works

Actual behavior

[fix-script]: Error! RangeError: Maximum call stack size exceeded
can't launch xcode project (xcode quits)

yarn install
yarn install v0.22.0
[1/4] ๐Ÿ”  Resolving packages...
success Already up-to-date.
$ react-native-schemes-manager all
Hiding schemes from node_modules xcode projects.
 โƒ  [fix-script]: Error! RangeError: Maximum call stack size exceeded
 โœ” [fix-libraries]: Release -> Staging created in node_modules/bugsnag-react-native/cocoa/BugsnagReactNative.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/bugsnag-react-native/cocoa/vendor/bugsnag-cocoa/iOS/Bugsnag.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/bugsnag-react-native/test-harness/ios/BugsnagReactNativeExample.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-appsee/ios/RNAppsee.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-blur/ios/RNBlur.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-code-push/ios/CodePush.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-cookies/RNCookieManagerIOS.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-device-info/RNDeviceInfo.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-keychain/RNKeychain.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-looped-carousel/Examples/Modal/ios/Modal.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-looped-carousel/Examples/Simple/ios/Simple.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-mixpanel/RNMixpanel.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-restart/Example/ios/Example.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-restart/ios/RCTRestart.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-touch-id/TouchID.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-youtube/RCTYouTube.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/ART/ART.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Image/RCTImage.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/RCTTest/RCTTest.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Sample/Sample.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Text/RCTText.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/React/React.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native/React/ReactLegacy.xcodeproj
 โœ” [hide-library-schemes]: node_modules/bugsnag-react-native/cocoa/vendor/bugsnag-cocoa/iOS/Bugsnag.xcodeproj/xcuserdata/delisa.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/bugsnag-react-native/cocoa/vendor/bugsnag-cocoa/iOS/Bugsnag.xcodeproj/xcuserdata/delisa.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-appsee/ios/RNAppsee.xcodeproj/xcuserdata/yonido.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-blur/ios/RNBlur.xcodeproj/xcuserdata/xamd.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-cookies/RNCookieManagerIOS.xcodeproj/xcuserdata/jmrodriguez.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-keychain/RNKeychain.xcodeproj/xcuserdata/joel.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-restart/ios/RCTRestart.xcodeproj/xcuserdata/avishay.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-touch-id/TouchID.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-touch-id/TouchID.xcodeproj/xcuserdata/naoufal.xcuserdatad/xcschemes hidden
 โœ” [hide-library-schemes]: node_modules/react-native-youtube/RCTYouTube.xcodeproj/xcuserdata/davidohayon.xcuserdatad/xcschemes hidden
โœจ  Done in 4.65s.

Error while parsing xcode project for react-native-maps

There's an error being raised while fixing react-native-maps v0.12.2. I added a little bit of logging to to figure out which file is failing:
react-native-maps/ios/Pods/Pods.xcodeproj/project.pbxproj

The version of Node I'm running is v6.3.0

Steps to reproduce the behavior

  1. create new project
react-native init scheme_manager_test --version [email protected]
  1. replace package.json with
{
  "name": "scheme_manager_test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "fix-xcode": "react-native-schemes-manager all",
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "xcodeSchemes": {
    "Release": [
      "Staging"
    ]
  },
  "dependencies": {
    "react": "15.4.2",
    "react-native": "0.38.1",
    "react-native-maps": "0.12.2"
  },
  "jest": {
    "preset": "react-native"
  },
  "devDependencies": {
    "babel-jest": "19.0.0",
    "babel-preset-react-native": "1.9.1",
    "jest": "19.0.2",
    "react-native-schemes-manager": "1.0.0-beta.8",
    "react-test-renderer": "15.4.2"
  }
}
  1. setup project
npm install
react-native link
  1. run fix-xcode
npm run fix-xcode

Expected behavior

fix-xcode should run to completion and add a staging configuration to react-native-maps.

Actual behavior

npm run fix-xcode

> [email protected] fix-xcode /Users/nhandyal/Documents/projects/zest/scheme_manager_test
> react-native-schemes-manager all

Hiding schemes from node_modules xcode projects.
ios/scheme_manager_test.xcodeproj
 โœ” [fix-script]: ios/scheme_manager_test.xcodeproj fixed
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-maps/ios/AirMaps.xcodeproj
 โœ” [fix-libraries]: Release -> Staging created in node_modules/react-native-maps/ios/Pods/GoogleMaps/Example/GoogleMapsDemos.xcodeproj
Failed for filePath:  /Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-maps/ios/Pods/Pods.xcodeproj/project.pbxproj

/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/src/utilities.js:58
				throw e;
				^
SyntaxError: Expected "/*", "//", or "{" but "<" found.
    at peg$buildStructuredError (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/node_modules/xcode/lib/parser/pbxproj.js:412:12)
    at Object.peg$parse [as parse] (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/node_modules/xcode/lib/parser/pbxproj.js:1886:11)
    at pbxProject.parseSync (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/node_modules/xcode/lib/pbxProject.js:46:24)
    at getFilesMatchingGlob.e (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/src/utilities.js:50:13)
    at glob (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/src/utilities.js:40:5)
    at f (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/node_modules/glob/glob.js:151:7)
    at emitOne (events.js:96:13)
    at Glob.emit (events.js:188:7)
    at Glob._finish (/Users/nhandyal/Documents/projects/zest/scheme_manager_test/node_modules/react-native-schemes-manager/node_modules/glob/glob.js:199:8)

Doesn't work for debug mode

it's my package.json, i run 'yarn install' and get successful, but i still not able to work in debug model with my react-native project
image
image
image

library not found for -lDoubleConversion clang: error: linker command failed

I am trying to set up a development environment and have created a new configuration and scheme called "DebugDev" that is getting a linker command failed error. My original "Debug" scheme is still building fine.

I have noticed during the build process that in my derived data folder, the library .a files get copied correctly to the "DebugDev-iphonesimulator" folder but the directories incorrectly get copied to "Release-iphonesimulator" instead of "DebugDev-iphonesimulator". This can be seen in the following images:

screen shot 2019-02-27 at 7 32 27 am

screen shot 2019-02-27 at 7 32 35 am

My package.json has the postinstall script and the following xcodeSchemes:
"xcodeSchemes": { "Debug": ["DebugDev"], "Release": ["ReleaseDev"], "projectDirectory": "iOS" }
I'm assuming I just have something in my project setup wrong. I've been stuck on this for quite some time and any help would be much appreciated! Thanks.

duplicate symbol in npm package

I have followed the instructions given in the documentation.

react-native run-ios still works fine
react-native run-ios --configuration Release still works fine,
react-native run-ios --configuration Staging throws an exception. It is not the same exception it threw before I tried to use this project, instead it prints:

duplicate symbol _OBJC_METACLASS_$_RCTNavigatorManager in: /path/to/ios/build/Build/Products/Release-iphonesimulator/libReact.a(RCTNavigatorManager.o) /path/to/ios/build/Build/Products/Staging-iphonesimulator/libReact.a(RCTNavigatorManager.o) and similiar messages for all other npm packages.

Followed by:

** BUILD FAILED **


The following build commands failed:

	Ld build/Build/Intermediates.noindex/flockCover.build/Staging-iphonesimulator/flockCover.build/Objects-normal/x86_64/flockCover normal x86_64
(1 failure)

Installing build/Build/Products/Staging-iphonesimulator/flockCover.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Staging-iphonesimulator/flockCover.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Any help would be greatly appreciated!

Command line script fails on CI with a non-standard iOS directory

Steps to reproduce the behavior

We run an automated build process using Jenkins when we commit our code.

This process was failing because we keep our Xcode project in a non-standard directory, iOS.

I need something to control this behavior. See #6 where I added a command line arg to allow this to be controlled

Expected behavior

Actual behavior

Error! RangeError: Maximum call stack size exceeded

$ react-native-schemes-manager all failed โƒ  [fix-script]: Error! RangeError: Maximum call stack size exceeded

$ yarn install
yarn install v0.27.5
[1/4] Resolving packages...
success Already up-to-date.
$ react-native-schemes-manager all
Hiding schemes from node_modules xcode projects.
 โƒ  [fix-script]: Error! RangeError: Maximum call stack size exceeded
...

It seems project schemes config correctly, but what can be a source of the issue?

directory not found for option '.../Beta.Debug-iphonesimulator/DoubleConversion' (cocoapods)

I have installed cocoapods in my project because of some dependencies that I use. I installed the plugin and configure my debug and release schemas.

When I run react-native run-ios --configuration Beta.Debug, appears these errors:

....
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/DoubleConversion'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/Folly'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/GLog'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/Protobuf'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/React'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/nanopb'
ld: warning: directory not found for option '-L/Users/juliocbr/Documentos/ReactNative/ocesa-events-app/ios/build/Build/Products/Beta.Debug-iphonesimulator/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)



** BUILD FAILED **

This is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'ocesa_app' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for ocesa_app
  pod 'Google-Mobile-Ads-SDK', '~> 7.0'
  pod 'Firebase/Core', '~> 4.13.0'
  pod 'Firebase/Messaging'
  # Add new pods below this line
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'BatchedBridge',
  ] 
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'


  # pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  # pod 'react-native-google-analytics-bridge', :path => '../node_modules/react-native-google-analytics-bridge'

  target 'ocesa_app-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ocesa_appTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'ocesa_app-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for ocesa_app-tvOS

end

I don't know if it is necessary to add some other configuration in xcode to avoid these errors. Thanks

React Native doesn't use index.ios.js as the entry point anymore

Steps to reproduce the behavior

For iOS React Native app, change the entry point file from index.ios.js to index.js.

Expected behavior

The build script should be able to find index.js when index.ios.js doesn't exist.

Actual behavior

When the scrip is ran, no entry file is found

...
Cannot find entry file index.ios.js in any of the roots: ["/path/to/my/app"]
...

Since React Native 0.49

https://github.com/facebook/react-native/releases/tag/v0.49.0

They changed the example project to use index.js instead of two index files for each platform. It seems this is not really something required for newer RN version, it's just the default template changed. However, I think using index.js should also be fine, we may need to look into index.ios.js first, fallback to index.js if it's not found.

add in --sourcemap-output ?

Any chance at adding in sourcemap into the build?

$NODE_BINARY "$REACT_NATIVE_DIR/local-cli/cli.js" bundle \
  --entry-file "$ENTRY_FILE" \
  --platform ios \
  --dev $DEV \
  --reset-cache \
  --bundle-output "$BUNDLE_FILE" \
  --assets-dest "$DEST"
  --sourcemap-output "$DEST/main.jsbundle.map"

I'm not sure if there are any implications for having it on all the time. Any thoughts?

fix-script fails if no debug configuration given

Steps to reproduce the behavior

Install plugin, but do not enter any Debug entries in package.json

  "xcodeSchemes": {
    "Release": ["ReleaseAlpha", "ReleaseBeta"]
  }

Expected behavior

fix-scripts to run successfully. This can be fixed by passing an empty array into debug.

  "xcodeSchemes": {
    "Debug": [],
    "Release": ["ReleaseAlpha", "ReleaseBeta"]
  }

Actual behavior

/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/fix-libraries.js:33
                for (const destinationBuildConfig of mappings[sourceBuildConfig]) {
                                                             ^

TypeError: mappings[sourceBuildConfig] is not iterable
    at updateProject (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/fix-libraries.js:33:48)
    at utilities.updateProjectsMatchingGlob (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/fix-libraries.js:86:10)
    at getFilesMatchingGlob (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/utilities.js:70:8)
    at glob (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/utilities.js:45:5)
    at f (/Users/chuck/Projects/aramis/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:151:7)
    at Glob.emit (events.js:160:13)
    at Glob._finish (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:197:8)
    at done (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:182:14)
    at Glob._processGlobStar2 (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:637:12)

Mono Repo Support

Currently, we're working with a mono repo, using workspaces, along with a few other tools. None of which directly relate to the issue.

A common step after running yarn, is for us to go ahead and change header search paths in certain dependencies, from

${SRCROOT}/../../../ios/Pods/Headers/Public
to
${SRCROOT}/../../../mobile/ios/Pods/Headers/Public

Steps to reproduce the behavior

Change header search paths to fit your project's structure (would need to have a structure that's atypical).

Expected behavior

Using this package, everything seems to be building correctly, except it seems to not be respecting the altered header search paths. The interesting thing is that if I use an original scheme, it builds just fine. Its only when using a custom scheme that this becomes an issue.

Actual behavior

Build fails, saying it cannot find a file.

Crash iOS - No bundle url present

Steps to reproduce the behavior

-Updated our non-expo react native project from 0.57.3 to 0.57.5
-installed react-native-firebase and react-native-splash-screen libraries (among others, but these seems to be related)

Expected behavior

-Running the application from Xcode will pickup the bundler / start it and properly start the application

Actual behavior

-running the application via command line react-native run-ios works fine, but when running from Xcode it fails to find the bundler and crashes on startup.
Make sure you're running a packager server or have included a .jsbundle file in your application bundle. 2018-11-28 11:30:46.161150-0500 Loadboard[81354:4917348] *** Terminating app due to uncaught exception 'RCTFatalException: No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle.', reason: 'No bundle URL present.

After debuging for a long period, I noticed if I change export NODE_BINARY=node ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh to use ../node_modules/react-native/scripts/react-native-xcode.sh instead everything works normally as expected.
On our package.json we have the following:
"xcodeSchemes": { "Debug": [ "Dev" ], "Release": [ "Beta" ], "projectDirectory": "ios", "settings": {} },
and on our build phase Bundle React Native code and images:
export DEVELOPMENT_BUILD_CONFIGURATIONS="+(Dev|Debug)" export NODE_BINARY=node ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh
Any idea why that might be happening? Let me know if any missing info

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.