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

xcodebuild warning in 0.48.3: The file reference for "libReact-tvOS.a" is a member of multiple groups ("Products" and "Products") #16061

Closed
vshab opened this issue Sep 21, 2017 · 12 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@vshab
Copy link
Contributor

vshab commented Sep 21, 2017

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.5
Node: 8.2.1
Yarn: 0.27.5
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.3 => 0.48.3

Steps to Reproduce

  1. react-native init AwesomeProject
  2. cd AwesomeProject
  3. react-native run-ios --simulator "iPhone 5s"

Expected Behavior

Build without warnings.

Actual Behavior

There is a warning in the very beginning of the build: 2017-09-22 02:36:04.856 xcodebuild[22182:165516] warning: The file reference for "libReact-tvOS.a" is a member of multiple groups ("Products" and "Products"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.

I've tried upgrading existing project and creating new one. There is no warning when building with react-native 0.47.2.

Reproducible Demo

Just a freshly created react native project.
https://github.com/vshab/react-native-0.48-build-warning

@janicduplessis janicduplessis added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. labels Sep 22, 2017
@leethree
Copy link

I'm seeing the exact same error. And Xcode 9 will try to fix the corrupted project.pbxproj file but resulting in potential conflicts.

@jonrh
Copy link

jonrh commented Oct 4, 2017

I'm seeing this in v0.49.0 as well.

@perrosnk
Copy link

I am seeing the same in v.0.49.3

@FiliSantillan
Copy link

it happens to me totally the same

react-native-cli: 2.0.1
react-native: 0.49.3

@aaronsmulktis
Copy link

aaronsmulktis commented Oct 31, 2017

same here!

Xcode 9
react-native-cli: 2.0.1
react-native: 0.44.0

@stabenfeldt
Copy link

Me too:

Xcode: Version 9.0.1 (9A1004)
react-native-cli: 2.0.1
react-native: 0.49.3

@douglowder
Copy link
Contributor

This is now fixed in PR #16076. @vshab please verify against latest master branch and close.

@mguerra10128
Copy link

mguerra10128 commented Dec 30, 2017

I still get an error when running npm run ios

2017-12-29 22:30:30.136 xcodebuild[1155:23978] warning: The file reference for "libReact-tvOS.a" is a member of multiple groups ("Products" and "Products"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.

@douglowder
Copy link
Contributor

douglowder commented Dec 31, 2017

Sorry for the trouble with this... the fix is in PR #17231 . If you want to get the fix immediately, you can use

"react-native": "https://github.com/dlowder-salesforce/react-native#tvos-cli-link-fix-2",

in your package.json. Otherwise, you can wait for this branch to get merged to a release version.

@tompark
Copy link

tompark commented Jan 15, 2018

I'm not sure why, but I wasn't able to use the package.json temporary fix above.
If anyone needs a temporary workaround, I wrote a little bash script to eliminate the warning. It uses the 'xcodeproj' gem (v1.4.3 or later) that's installed with Cocoapods, and runs from the project root:

#!/bin/bash
proj_name=${PWD##*/}
cat >| ./dedupe_filerefs_in_groups.rb <<-EOF
#!/usr/bin/ruby
require 'xcodeproj'
app_name = '${proj_name}'
project_file = "./ios/#{app_name}.xcodeproj"
project = Xcodeproj::Project.open(project_file)

project.root_object.project_references.each { |projref|
  group = projref[:product_group]
  dupes = group.children.group_by{ |obj| obj.uuid }.values.select { |a| a.size > 1 }.flatten.uniq
  dupes.each { |dupe|
    group.children.delete(dupe)
    group.children<<(dupe) # delete will remove all instances, so have to add one back in
  }
}
project.save(project_file)
EOF
ruby ./dedupe_filerefs_in_groups.rb
rm -f ./dedupe_filerefs_in_groups.rb

When the 'xcodeproj' library reads the project, it also recognizes the 'libReact-tvOS.a' PBXBuildFile entry that was misnamed as 'libReact.a' and it will rename it automatically, so there was no need to add code to fix that problem.
This is totally a stopgap fix, so it's probably not very useful to most people.

@vshab
Copy link
Contributor Author

vshab commented Jan 17, 2018

@dlowder-salesforce just tested on RN 52 for existing and new projects - can't see the message anymore. So I think it is fixed. Should I close?

@douglowder
Copy link
Contributor

@vshab yes you can close this

@vshab vshab closed this as completed Jan 17, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jan 17, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests