R.swift: R.generated.swift for multiple targets?

Created on 26 Apr 2017  路  4Comments  路  Source: mac-cain13/R.swift

I have tried all the possible thing that I could before posting here. and look into all issues in this repo but couldn't find any clues.

My project has to have multiple target for Swift 3.1 like production, staging, and etc
I've used R.swift since the project is started and it's working fine until last 2-3 days after I have added more Targets in the xcode and it's failed to build on other targets but the original one is still working

Here's the Error that I've got
screen shot 2017-04-26 at 11 09 22 am

I have different project LivePopKit to import into our project. That's project is just for Our API, and Model to use in this project.
screen shot 2017-04-26 at 11 16 22 am

But My main app is still working fine, just different target is not working. I suspect that it would because of sharing R.generated.swift for 3 different targets? but 3 different targets have exactly the same config because I did duplicated on the original one that's all. the different is just Display name and Bundle Identifier. that's it.

even I did rename my main target to other name and rename my new targets to be the same name as original. it's still not working. They have error about in R.generated.swift about Could not infer type XXX XXX is Project name

Do you have any recommend for me to look for?
Thank you

Most helpful comment

I think I've been able to reproduce your issue in a test project.

In your storyboard, do you have "LivePop" set as an explicit module for the TagsPageController?
If so, try checking the "Inherit From Target" setting:

screen shot 2017-04-26 at 06 55 46

All 4 comments

I think I've been able to reproduce your issue in a test project.

In your storyboard, do you have "LivePop" set as an explicit module for the TagsPageController?
If so, try checking the "Inherit From Target" setting:

screen shot 2017-04-26 at 06 55 46

It's all checked as Inherit From Target

Below is the storyboard that showing an error in the code
screen shot 2017-04-26 at 1 25 43 pm

but isn't it weird that only this storyboard that has a problem? or maybe it's show just this error first and might show more when I can solved this part. I did picked the module to be for that specific target in that storyboard and try to build. it's not working also
screen shot 2017-04-26 at 1 27 56 pm

I'm still investigated more into it. I strongly believe that it should be a problem with naming thing

Oh by the way this is my pod
screen shot 2017-04-26 at 1 33 28 pm
not quite sure if I did something wrong also?

Is there -> LivePop.CreateBroadcastViewController? in the generated code?
Checking the box "Inherit From Target" should make R.swift generate: -> CreateBroadcastViewController?

Are you passing any extra arguments to the rswift executable?

@tomlokhorst Thanks for your help!!!!

I just look into all the storyboard from your guide and it's seem that some storyboard has untick the module so it's cause the problem because it's not inherit from target anymore

It's working and keep building but I found out new problem again :\

screen shot 2017-04-26 at 2 13 11 pm

Ok this problem is solved after I clear Derived data and build it again.

Ok everything is working correctly now. Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreadelfante picture andreadelfante  路  6Comments

tomlokhorst picture tomlokhorst  路  3Comments

aliasdoc picture aliasdoc  路  3Comments

Horse888 picture Horse888  路  5Comments

scaio picture scaio  路  3Comments