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

Running Xcode's "analyze" on Yoga code surfaces issues #12609

Closed
Kennytian opened this issue Feb 28, 2017 · 37 comments
Closed

Running Xcode's "analyze" on Yoga code surfaces issues #12609

Kennytian opened this issue Feb 28, 2017 · 37 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Kennytian
Copy link

run react-native run-ios command

Description

The following commands produced analyzer issues:
Analyze /Users/kenny/projects/almondWallet/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c

Analyze /Users/kenny/projects/almondWallet/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
(2 commands with analyzer issues)

The following build commands failed:
Analyze /Users/kenny/projects/almondWallet/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
Analyze /Users/kenny/projects/almondWallet/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
(2 failures)

Additional Information

  • React Native version: 0.41.2
  • Platform: iOS
  • Operating System: MacOS

Please tell me, how to fix Yoga analyze issues, thanks guys!

@JINC06
Copy link

JINC06 commented Feb 28, 2017

I have the same issue

`** BUILD FAILED **

The following commands produced analyzer issues:

Analyze /Users/julionava/ReactNative\ Projects/PlatziMusic/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/julionava/ReactNative\ Projects/PlatziMusic/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c

(2 commands with analyzer issues)

The following build commands failed:
Analyze /Users/julionava/ReactNative\ Projects/PlatziMusic/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
CompileC /Users/julionava/ReactNative\ Projects/PlatziMusic/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/yoga.build/Objects-normal/x86_64/Yoga.o /Users/julionava/ReactNative\ Projects/PlatziMusic/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
Analyze /Users/julionava/ReactNative\ Projects/PlatziMusic/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
CompileC /Users/julionava/ReactNative\ Projects/PlatziMusic/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/yoga.build/Objects-normal/x86_64/YGNodeList.o /Users/julionava/ReactNative\ Projects/PlatziMusic/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
(4 failures)
`

@DataGreed
Copy link

Have the same problem

@ide ide added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. labels Mar 2, 2017
@ide ide changed the title How to fix Yoga analyze issues Running Xcode's "analyze" on Yoga code surfaces issues Mar 2, 2017
@wachunei
Copy link

wachunei commented Mar 4, 2017

Same issue here!

@taiki-t
Copy link

taiki-t commented Mar 4, 2017

I had the same issue and for my case, deleting ios/build directory and re-running react-native run-ios solved.
Errors shown were something like this:

PCH was compiled with module cache path '/old_path/ios/build/ModuleCache/241WD87OSBWAM', but the path is currently 'new-path/ios/build/ModuleCache/241WD87OSBWAM'

This happened as I imported most of project files from another project.

@jamesfoxlee
Copy link

@taiki-t Thank you! Deleting ios/build fixed it.

In my case I hadn't imported files from an old project, but obviously something had gotten stale somewhere.

@hobbyexplorer
Copy link

deleting ios/build fixed it!

@ide ide removed Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. labels Mar 10, 2017
@amitbravo
Copy link

I changed app name and app id(bundle identifier) . since then it was crashing with react-native run-ios . by deleting ios/build fixed it !!

@Luthfiansyah
Copy link

thanks deleting ios/build fixed it.

@ODelibalta
Copy link

Deleting ios/build did not fix my issue.

@fancyboynet
Copy link

I have the same issue, and deleting ios/build did not work.

@oliviachang29
Copy link

Strangely, I get this issue but my build succeeds.

@amberv0
Copy link

amberv0 commented Aug 8, 2017

Same here, deleting the ios/build does not help, at the same time, the build succeeds.

@wmonecke
Copy link

This issue happened to me once I duplicated my project. I literally copy pasted it and tried to run it. This is the error that I got.

@miguelramosfdz
Copy link

same here

@AggarwalAnkit
Copy link

AggarwalAnkit commented Aug 28, 2017

I am also getting this issue. It shows build succeeded but hangs at installation. Please someone help me with this. I create a new project using react-native init project and simply ran it using react-native run-ios.

@caseybaggz
Copy link

Same here.

@rbivan
Copy link

rbivan commented Sep 1, 2017

Same for me. The build succeeds with the analyzer issues but app starts and crash in simulator. Also android app runs OK

@MorganIsBatman
Copy link

Getting the same problem trying to launch the tutorial project - Simulator launches, it looks like the app is launching in the simulator, then the app crashes. When I click the app icon on the home screen of the simulator, it launches then immediately closes.

Have tried launching it in the simulator from Xcode and it crashes too.

I see 4 logic errors relating to Yoga in Xcode:

YGNodeList.c:26:18: Access to field 'capacity' results in a dereference of a null pointer (loaded from variable 'list')

YGNodeList.c:72:22: Array access (via field 'items') results in a null pointer dereference

Yoga.c:352:3: Null pointer argument in call to memory copy function

Yoga.c:426:3: Null pointer argument in call to memory copy function

Looking at the simulator logs, the crash report contains:
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa313534393830327'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 338.16 - Device: iPhone 6 - Runtime: iOS 10.2 (14C89) - DeviceType: iPhone 6

@rbivan
Copy link

rbivan commented Sep 2, 2017

Temporal solution in #15762 by @cxgslegend works for me.

Use previous version of react native in init
react-native init --version 0.47.0 <projectname>

IOS app in simulator working OK

@aashutoshjha
Copy link

HELP!!!Facing the same issue and deleting ios/build doesn't fix it

The following commands produced analyzer issues:

Analyze /Users/ashutosh/bhajiwala/bhajiwala/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
Analyze /Users/ashutosh/bhajiwala/bhajiwala/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c

(2 commands with analyzer issues)

The following build commands failed:
CompileC /Users/ashutosh/bhajiwala/bhajiwala/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/MallocImpl.o /Users/ashutosh/bhajiwala/bhajiwala/node_modules/react-native/third-party/folly-2016.09.26.00/folly/detail/MallocImpl.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/bhajiwala.app
No devices are booted.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

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

@caseybaggz
Copy link

@aashutoshjha check out the comment above by @rbivan . That worked for me and some others.

@AggarwalAnkit
Copy link

@aashutoshjha I did sudo npm start to start packager and then ran react-native run-ios and that worked for me. I don't know the reason

@aashutoshjha
Copy link

Thanks @caseybaggz @AggarwalAnkit , tried both the things. Solved the analyzer issues but it still fails:

The following build commands failed:
CompileC /Users/ashutosh/bhajiwala/bhajiwala/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/MallocImpl.o /Users/ashutosh/bhajiwala/bhajiwala/node_modules/react-native/third-party/folly-2016.09.26.00/folly/detail/MallocImpl.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/bhajiwala.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/Debug-iphonesimulator/bhajiwala.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

@andreechristian
Copy link

I also got this problem. Build succeeds but immediately crash after splash screen opened. While if i run the app via XCode, it runs perfectly. :( whyyyy

@zamudpoe
Copy link

zamudpoe commented Dec 8, 2017

SOLUTION:
rm -rf ios/build/ModuleCache/*

@ChristopherSheehan01
Copy link

@aashutoshjha I'm having the exact same issue you are, did you ever manage to solve it?

** BUILD FAILED **

The following commands produced analyzer issues:
Analyze /Users/ChrisSheehan/react-native/mapTest/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/ChrisSheehan/react-native/mapTest/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
Analyze Base/RCTModuleMethod.mm
(3 commands with analyzer issues)

The following build commands failed:
CompileC /Users/ChrisSheehan/react-native/mapTest/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-google-maps.build/Objects-normal/x86_64/AIRGoogleMapManager.o /Users/ChrisSheehan/react-native/mapTest/node_modules/react-native-maps/lib/ios/AirGoogleMaps/AIRGoogleMapManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/mapTest.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/Debug-iphonesimulator/mapTest.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

@Suraj-Tiwari
Copy link

I got a solution that might work for you

  1. rm -rf ios/build
  2. sudo react-native run-ios

make sure your pc has internet connectivity.

@ahmad2smile
Copy link

Please don't do

sudo react-native run-ios

Its the worst advice ever. After doing this command doesn't open simulator and dependency watcher requires sudo permissions too then if you run in normal permissions watcher errors out cause It can't access some files which had elevated privileges previously

@arshbot
Copy link

arshbot commented Jan 3, 2018

@aashutoshjha Having a similar issue as you, did you ever solve it?

The following build commands failed:

	CompileC build/Build/Intermediates.noindex/hail-react-native.build/Debug-iphonesimulator/hail-react-nativeTests.build/Objects-normal/x86_64/hail-react-nativeTests.o hail-react-nativeTests/hail-react-nativeTests.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

With the associated error message:

screen shot 2018-01-03 at 12 55 54 am

@aashutoshjha
Copy link

@arshbot @ChristopherSheehan01 Wasn't able to solve it by any of the above solutions. The issue if I correctly remember was due to misplaced files in folders. Had to copy the code, create a fresh new file from X-Code and paste it there.

@arshbot
Copy link

arshbot commented Jan 3, 2018

I resolved this with this comment after trying every solution under the sun.

  1. delete ios/ or android/
  2. react-native eject <-- this was what did it for me
  3. react-native-git-upgrade
  4. react-native link
  5. react-native run-ios

@ersinakinci
Copy link

I had this exact same problem and found other errors buried in the log:

  1. My iPhone was connected but wasn't unlocked and I didn't enter my code to trust my computer.
  2. Port 8081 was blocked (in my case, because webpack-dev-server was running in the background for a totally unrelated project), so Metro Bundler couldn't launch.

Once I unlocked/trusted and killed webpack-dev-server, the error went away and the build succeeded in the simulator. Not sure whether/how my physical iPhone is relevant, perhaps port 8081 was the only blocking problem, but I did both just to be safe.

Btw, this was on a new project after having run react-native init.

@Luckygirlllll
Copy link

I have the same issue. deleting ios/build didn't help me! any other solutions?

@armaanahluwalia
Copy link

Thanks @arshbot ... your solution worked for me -
MacOS 10.11.6

@Jaafar-abusair
Copy link

try

pod update yoga
pod install

if you are using Pod

@KunalPaul
Copy link

removing the ios folder and then recreating it does the job but don't forget to do react-native link

@mustafaskyer
Copy link

i follow these steps simply And it works for me :)
1 - rm -rf node_modules/
2 - yarn install
3 - react-native link
4 - cd ios && pod install
5 - cd .. && react-native run-ios

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests