Hi I have problem in using R.swift. I do every step of installing R.swift using Pods in Xcode 10 but I have this error and no R.generated.swift generated :
[R.swift] The folder “R.generated.swift” doesn’t exist.
Are you using the latest version of R.swift? What is the build step script you're using?
Does it match the installation instructions:
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
me too have the same problem three times follow the instructions in xcode 10 and 9.4 , and every time this error happen .
error: [R.swift] The folder “R.generated.swift” doesn’t exist.
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
What version of R.swift are you using? It sounds like you're using an older version that expects to receive a folder instead of a file.
4.0.0 for swift 4.1
and 5.0.0 for 4.2
I have the same issue with xCode 10.1, 4.0.0 for RSwift.
@mac-cain13
Are you using the latest version of R.swift? What is the build step script you're using?
Does it match the installation instructions:
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
I exactly do the installation steps correctly
Still getting this error
error: [R.swift] The folder “R.generated.swift” doesn’t exist.
Command PhaseScriptExecution emitted errors but did not return a nonzero exit code to indicate
failure
@erfanwakka
I had the same problem but update R.swift pod to 5.0.2 (I had 4.0.0) solved it.
Same issue I am on latest 5.0.2, any update?
Same here
Can any of you provide a proper reproduction path?
Are you using the latest version?
What is the build script you're using?
What are the error messages that are being emitted?
What did you change from when it did work? (if applicable)
Without this, there's nothing much I can look into, as this hasn't happend in any of the many R.swift projects I'm using.
Having the same issue:
[R.swift] The folder “R.generated.swift” doesn’t exist.
Using R.swift version 4.0.0 in an app with Swift 3 and Xcode 10.1. I used the following Build Script. "$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
When I create an empty R.generated.swift in SRCROOT on my own, the error message changes to
The file “R.generated.swift” couldn’t be saved in the folder “R.generated.swift”.
Is R.swift maybe missing required rights to write on disk?
With R.swift version 4, you shouldn't include the filename:
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT"
https://github.com/mac-cain13/R.swift/tree/v4.0.0#cocoapods-recommended
This was changed in R.swift 5
I had the same issue, with removing all Xcode cached data from /library it resolved
Assuming this is solved now. Feel free to open a new issue if R.swift doesn't generate the file for you correctly.
This isn't solved. I Updated to swift 5 and R.Swift 5.0.3 and i cannot regenerate my r file. I followed the latest instructions https://github.com/mac-cain13/R.swift/tree/v4.0.0#cocoapods-recommended. I saw the last comment form @hamedaakhlaghi but I don't know what cache folders you mean exactly? Just derived data?
I have the correct settings in run scrip phase:
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
"$PODS_ROOT/R.swift/rswift" "$SRCROOT" "${PODS_ROOT}/Fabric/upload-symbols" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}";
This is most frustrating issue... please help. I am so stuck trying to do it all day and no luck...just cannot get it building... just goes through to compiling my Source Files and then doens't understand the use of R but doesn't generate the R files either???? Help please!
Ok fixed... after hours of puzzling. I just deleted everything from the R.generated file, but kept the file in the same path as specified in the run script phase, and it regenerated the code. BUT. If i delete the file it won't regenerate it AT ALL, maybe this is a caching thing in xcode. Have no idea @mac-cain13 ?
Note that if you're using R.swift 5, you should use the latest installation instructions https://github.com/mac-cain13/R.swift#cocoapods-recommended (not the ones for R.swift 4).
If you're upgrading from R.swift 4 to R.swift 5, see the migration guide: https://github.com/mac-cain13/R.swift/blob/master/Documentation/Migration.md#upgrading-to-50
@benSmith1981 makes me sad to hear R.swift did cost you hours of puzzling.
Could you confirm that you where using the R.swift 5 instructions/migration steps? Is it still the case that the generated file doesn't update or is it now fixed since you once emptied the file?
It would help enormously if I can get my hands on a demo or real project where this is going wrong so we can investigate. It's probably just a tiny thing that's misconfigured but very hard to find once it's broken. Do you think it's possible to share a project in the same broken state you experienced?
Most helpful comment
With R.swift version 4, you shouldn't include the filename:
"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT"https://github.com/mac-cain13/R.swift/tree/v4.0.0#cocoapods-recommended
This was changed in R.swift 5