openbakery / gradle-xcodePlugin

gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS
Apache License 2.0
455 stars 127 forks source link

Generated Symroot folder structure unrecognized by archive task #459

Open thipokch opened 2 years ago

thipokch commented 2 years ago

Thanks for the cool plugin. Please help me find out why the folder structure

When I copied the xcodebuild command from Gradle debug mode and run it in terminal, it seems to be generating what archive task expects.

# Achieve task expects this
# and Build task sometimes generates this folder structure. 

build/
├─ sym/
│  ├─ Debug-iphoneos/
│  │  ├─ .ipa
│  │  ├─ .sym
│  │  ├─ ...
├─ ...
# Build task most often time generates this folder structure.

build/
├─ sym/
│  ├─  .ipa
│  ├─  .sym
│  ├─  ...
├─ ...

Here's my build.gradle.kts (I also did it with groovy and it's the same issue).

gradle.taskGraph.whenReady {
      xcodebuild {
          scheme = "dev"
          target = "example"

          configuration = "Release"
          simulator = false

          infoplist {
              bundleIdentifier = "ch.thipok.example.dev"
              bundleDisplayName = "Example Dev"
          }
    }
}

I tried working around this issue, by running archive task, but the command resulted issue as seen in #457.

thipokch commented 2 years ago

Seems to be caused by ProcessBuilder. I replaced ProcessBuilder with Gradle's exec and the command seems to be working.

renep commented 1 year ago

Very strange. I never had this issue. The ProcessBuilder itself is used so that environment variables can be passed to the process that is executed (e.g. xcodebuild). In the debug log you should see want environment variables are set to the ProcessBuilder. Maybe this is the cause for this problem.

renep commented 1 year ago

One other question: What Xcode Version do you use, and what gradle version?