skiptools / skiptools/skip

swift build command line issue

Open
#162 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cli project
Dominant language
Swift
Stars
3.2k
Forks
106
Avg merge
6d 13h
Merged PRs (30d)
1

Description

First of all, Thanks for your hard working!

I found an error that occurs when I try to export gradle project.
I tried this one below

$ skip init --appid=com.xyz.HelloSkip hello-skip HelloSkip

Initializing Skip library hello-skip
[✓] Create project hello-skip (0.73s)
[✓] Resolve dependencies (5.89s)
[✓] Build hello-skip (15.2s)
[✓] Created module HelloSkip in ~/Desktop/hello-skip/HelloSkip.xcodeproj

$ cd hello-skip 

$ swift build --build-tests

Fetched https://source.skip.tools/skip.git (0.92s)
…
[294/294] Linking libHelloSkip.dylib
Build complete! (23.13s)

$ skip gradle -p .build/plugins/outputs/hello-skip/HelloSkip/skipstone/HelloSkip test

GRADLE> > Task :HelloSkip:preBuild UP-TO-DATE
…
GRADLE> > Task :HelloSkip:testDebugUnitTest
GRADLE> > Task :HelloSkip:test
GRADLE> 
GRADLE> BUILD SUCCESSFUL in 20s
GRADLE> 204 actionable tasks: 204 executed
note: Gradle SUCCESSFUL

$ skip gradle -p Android/ assemble

GRADLE> > Task :app:preBuild UP-TO-DATE
GRADLE> > Task :app:preDebugBuild UP-TO-DATE
GRADLE> > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
GRADLE> > Task :app:generateDebugBuildConfig
GRADLE> > Task :HelloSkip:preBuild UP-TO-DATE
…
GRADLE> > Task :SkipUI:bundleReleaseAar
GRADLE> > Task :HelloSkip:compileDebugJavaWithJavac NO-SOURCE
…
GRADLE> > Task :app:processReleaseJavaRes
GRADLE> > Task :HelloSkip:extractDebugAnnotations
GRADLE> > Task :HelloSkip:mergeDebugGeneratedProguardFiles
GRADLE> > Task :HelloSkip:mergeDebugConsumerProguardFiles
GRADLE> > Task :SkipUI:assembleRelease
GRADLE> > Task :SkipUI:assemble
GRADLE> > Task :HelloSkip:mergeDebugJavaResource
GRADLE> > Task :app:compileDebugKotlin
GRADLE> > Task :HelloSkip:syncDebugLibJars
GRADLE> > Task :app:compileDebugJavaWithJavac
GRADLE> > Task :app:mergeReleaseJavaResource
GRADLE> > Task :app:dexBuilderDebug
GRADLE> > Task :app:processDebugJavaRes
GRADLE> > Task :app:mergeDebugGlobalSynthetics
GRADLE> > Task :app:mergeProjectDexDebug
GRADLE> > Task :app:mergeLibDexDebug
GRADLE> > Task :HelloSkip:bundleDebugAar
GRADLE> > Task :HelloSkip:assembleDebug
GRADLE> > Task :HelloSkip:assemble
GRADLE> > Task :app:mergeDebugJavaResource
GRADLE> > Task :app:minifyReleaseWithR8
GRADLE> > Task :app:shrinkReleaseRes
GRADLE> > Task :app:packageRelease
GRADLE> > Task :app:createReleaseApkListingFileRedirect
GRADLE> > Task :app:assembleRelease
GRADLE> > Task :app:assemble
GRADLE> 
GRADLE> BUILD SUCCESSFUL in 53s
GRADLE> 403 actionable tasks: 403 executed

this is the instruction in DOCS -> Gradle Projects -> Building Locally

but when I tried swift build --build-tests it shows me many error messages like below

Desktop/myMac/Apps/hello-global/Sources/HelloGlobal/ContentView.swift:68:87: error: Skip is unable to determine the owning type for member 'light'. This often occurs when other issues prevent Skip from matching the surrounding API call, and it may resolve when those issues are fixed. Or add the owning type explicitly (e.g. MyType.light)
        .preferredColorScheme(appearance == "dark" ? .dark : appearance == "light" ? .light : nil)
                                                                                      ^~~~~

In Xcode, it doesn't any matter but when I try to build with CLI, this kind of error message appears.
I tried this with `skip test' again and then saw log.

[51/64] Skip ProjectRun
[52/64] Compiling SkipDrive Version.swift
[53/64] Emitting module SkipDrive
[54/64] Compiling SkipDrive GradleHarness.swift
error: fatalError

Even error log doesn't tell me what is wrong.

I'm trying to follow your instructions in DOCS but keep failing.
Is there any doc that I can follow to make an .apk file manually?

I can manage about iOS Side with Xcode but have no idea what should I do if I want to extract .apk to test with my phone and manually upload .aab file

Thanks again and have a great day!!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing swift build --build-tests and skip test, comparing the CLI output with the successful Xcode build. Inspect the reported ContentView.swift line 68 and the Gradle Projects → Building Locally documentation; done means the CLI failure has an actionable diagnosis or the manual APK/AAB workflow is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, swift
Domain
build-system, cli, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.