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

Getting Started Creating an App fails to build #253

Open
wcwynn opened this issue Oct 7, 2024 · 14 comments
Open

Getting Started Creating an App fails to build #253

wcwynn opened this issue Oct 7, 2024 · 14 comments

Comments

@wcwynn
Copy link

wcwynn commented Oct 7, 2024

Following the getting started guide and creating an app, the created app fails to build. There appears to be a missing Skip output folder (or the folder is located in the wrong location).

Skip Checkup

skip checkup                                                               
[✓] Skip version 1.1.8 (= 1.1.8)
[✓] macOS version 14.5 (> 13.5.0)
[!] Error running sysctl (Intel)
[✓] Swift version 5.10 (> 5.9.0)
[✓] Xcode version 15.4 (> 15.0.0)
[✓] Xcode tools SDKs: 9
[✓] Homebrew version 4.4.0 (> 4.1.0)
[✓] Gradle version 8.10.2 (> 8.6.0)
[✓] Java version 23 (> 21.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2024.2
[✓] Android tools SDKs: 1
[✓] Resolve dependencies (20.8s)
[✓] Build hello-skip (25.55s)
[✓] Test Swift (13.49s)
[✓] Test Kotlin (83.9s)
[✓] Archive iOS ipa (40.84s)
[✓] Assemble HelloSkip-release.ipa 38 KB
[✓] Verify HelloSkip-release.ipa 38 KB
[✓] Assembling Android apk (276.1s)
[✓] Verify HelloSkip-release.apk 13.9 MB
[✓] Check Swift Package (1.2s)
[✓] Check Skip Updates: 1.1.8
[!] Skip 1.1.8 checkup with 1 warning

Creating an App

skip init --appid=so.monochrome.SkipToolsEval skip-tools-eval SkipToolsEval
open skip-tools-eval/Darwin/SkipToolsEval.xcodeproj

Build Failure (skip-gradle.log.txt output)

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/dev/tree/mc-personal-projects/skip-tools-eval/Android/settings.gradle.kts' line: 36

* What went wrong:
Missing expected Skip output folder: /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination/skipstone/buildSrc. Run `swift build` in the root folder to create, or specify Xcode environment BUILT_PRODUCTS_DIR.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s

Missing directory and files

It seems the Android/settings.gradle.kts is expecting a directory to be located in one location when it is actually present in a different location:

~  ls /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination/skipstone/buildSrc                
ls: /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination/skipstone/buildSrc: No such file or directory
~  ls /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination/skipstone         
ls: /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination/skipstone: No such file or directory
~  ls /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination          
ls: /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination: No such file or directory

~  ls -al /Users/dev/Library/Developer/Xcode/DerivedData/SkipToolsEval-drnuzvxgpyenkpccykndkmvzksld/SourcePackages/plugins/skip-unit.output/SkipUnit/skipstone 
total 48
drwxr-xr-x  10 dev  staff    320 Oct  7 15:52 .
drwxr-xr-x   3 dev  staff     96 Oct  7 14:16 ..
-rw-r--r--   1 dev  staff    324 Oct  7 15:52 .SkipUnit.sourcehash
drwxr-xr-x   5 dev  staff    160 Oct  7 14:16 SkipUnit
-rw-r--r--   1 dev  staff  10329 Oct  7 14:16 SkipUnit.skipcode.json
-rw-r--r--   1 dev  staff      0 Oct  7 14:16 SkipUnitSwiftBridge.swift
drwxr-xr-x   5 dev  staff    160 Oct  7 15:52 buildSrc
drwxr-xr-x   3 dev  staff     96 Oct  7 14:16 gradle
-rw-r--r--   1 dev  staff     78 Oct  7 14:16 gradle.properties
-rw-r--r--   1 dev  staff   2699 Oct  7 14:16 settings.gradle.kts
@marcprux
Copy link
Contributor

marcprux commented Oct 7, 2024

Thanks for the detailed report. If you perform a clean rebuild, can you let us know if you get the same error? This has been an intermittent issue with Xcode 15 where the plugins are sometimes executed in the wrong order, and it usually goes away with a clean rebuild.

(For the record, the incorrect directory reference skip-unit.output/SkipUnit/destination/skipstone versus skip-unit.output/SkipUnit/skipstone is likely not the issue; the plugin output folders changed in Xcode 16, which means we have to check both – the error message is just referencing the final location checked, but it would have checked both locations and succeeded if either were found)

@wcwynn
Copy link
Author

wcwynn commented Oct 7, 2024

I tried a clean rebuild a few times but received the same error. I also completely removed the skip-tools-eval directory and tried again from scratch but unfortunately received the same error.

@marcprux
Copy link
Contributor

marcprux commented Oct 7, 2024

How about running Xcode's File/Packages/Reset Package Caches and then doing a clean re-build?

Also, did the skip init command pass? That also tried to build the project, so if it passed and Xcode is failing, then something is amiss. If you open the Terminal and cd to the package folder and run skip export, does it pass? If not, can you post the failure log?

@wcwynn
Copy link
Author

wcwynn commented Oct 8, 2024

How about running Xcode's File/Packages/Reset Package Caches and then doing a clean re-build?

Unfortunately, this did not resolve the problem.

Also, did the skip init command pass?

Yes, it seemed to pass.

If you open the Terminal and cd to the package folder and run skip export, does it pass?

Yes, it seemed to pass.

Here is the output:

~/tree/mc-personal-projects/skip-tools-eval  skip export       
[✓] Check Swift Package (1.29s)
[✓] Build project skip-tools-eval (12.01s)
[✓] Archive iOS ipa (28.65s)
[✓] Assemble SkipToolsEval-debug.ipa 841 KB
[✓] Archive SkipToolsEval-debug.xcarchive.zip 1.7 MB
[✓] Archive iOS ipa (26.56s)
[✓] Assemble SkipToolsEval-release.ipa 310 KB
[✓] Archive SkipToolsEval-release.xcarchive.zip 2.9 MB
[✓] Assemble Android app SkipToolsEval (283.46s)
[✓] Export SkipToolsEval-debug.apk: 70.3 MB
[✓] Export SkipToolsEval-release.apk: 13.9 MB
[✓] Bundle Android app SkipToolsEval (16.69s)
[✓] Export SkipToolsEval-debug.aab: 19 MB
[✓] Export SkipToolsEval-release.aab: 9 MB
[✓] Export project for SkipToolsEval
[✓] Archive project source SkipToolsEval-project.zip 593 KB
[✓] Skip export skip-tools-eval to ./.build/skip-export (372.37s)
[✓] Skip 1.1.8 export succeeded in 372.37s
~/tree/mc-personal-projects/skip-tools-eval 

@marcprux
Copy link
Contributor

marcprux commented Oct 8, 2024

Hmm. Very odd.

Can you try checking out the default "Hello" sample app from https://github.com/skiptools/skipapp-hello and opening that in Xcode and seeing if that builds? If not, can you post the complete gradle error log?

@wcwynn
Copy link
Author

wcwynn commented Oct 8, 2024

I received the same build error for the "Hello" sample app.

skip-gradle.log.txt


FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/dev/tree/mc-personal-projects/skipapp-hello/Android/settings.gradle.kts' line: 36

* What went wrong:
Missing expected Skip output folder: /Users/dev/Library/Developer/Xcode/DerivedData/SourcePackages/plugins/skip-unit.output/SkipUnit/destination/skipstone/buildSrc. Run `swift build` in the root folder to create, or specify Xcode environment BUILT_PRODUCTS_DIR.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s

I noticed in both projects the plugins is showing in red (see image).

Screenshot 2024-10-08 at 11 32 13 AM

@marcprux
Copy link
Contributor

marcprux commented Oct 8, 2024

Can you post the complete skip-gradle.log.txt file from when it fails (either your own project or the Hello sample)? There might be other warnings or errors in there that indicate what went wrong…

@wcwynn
Copy link
Author

wcwynn commented Oct 8, 2024

Please see the details of my previous message and original issue description for the skip-gradle.log.txt files. I think they are complete but if there is another file you're expecting just let me know.

@marcprux
Copy link
Contributor

marcprux commented Oct 8, 2024

I see the excerpt of the skip-gradle.log.txt file that you posted, but I'd like to see the entire file in order to see if it contains any earlier errors or warnings. Can you attach it to this issue? You should be able to command-click on it and open it in the Finder to get the file reference.

@wcwynn
Copy link
Author

wcwynn commented Oct 9, 2024

Here are the files using the file reference from Finder (following your instructions).
skip-gradle.log.txt
skip-gradle.log.txt

@luisBoost
Copy link

@marcprux any news here? having same issue, when trying to build it throws
Screenshot 2024-11-15 at 7 16 51 AM

@marcprux
Copy link
Contributor

@luisBoost I think this is a different issue: that "skipstone" is disabled error just means that the plugin has not been approved by you. You should have seen a dialog box asking for permission to run the plugin when you tried to build the project. If you clean the build and re-start Xcode and open the project again, do you get the dialog?

@luisBoost
Copy link

@luisBoost I think this is a different issue: that "skipstone" is disabled error just means that the plugin has not been approved by you. You should have seen a dialog box asking for permission to run the plugin when you tried to build the project. If you clean the build and re-start Xcode and open the project again, do you get the dialog?

@marcprux Thanks for the quick response, im not seeing the dialog, I know which one it is. but have been trying to get it to show and nothing, it just fails immediately after tapping the build button.
have tried to remove derived data, a deep clean, reset the packages and no luck

@luisBoost
Copy link

after restarting the Mac, I was able to see the "enable" button to show the modal after trying to build, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants