Coder Social home page Coder Social logo

skip's People

Contributors

aabewhite avatar marcprux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skip's Issues

Working fine in iOS not in Android

I'm encountering a peculiar issue where I've implemented an API and successfully populated a list with it. Everything runs smoothly without errors on iOS. However, on Android, it doesn't display anything, and I'm having difficulty understanding what might be missing.

if am using local data it was working only remote data not showing in android

i am posting code where I am facing

// ContentView
struct ContentView: View {

@StateObject var viewModel = ViewModel()

var body: some View {
    NavigationStack {
        List(viewModel.repos, id: \.id) { repo in
            NavigationLink(value: repo) {
                listRow(repo: repo)
            }
        }
        .navigationDestination(for: Repo.self, destination: { repo in
            RepoDetailView(owner: repo.owner)
        })
        .navigationTitle("Repos")
        .task {
            await viewModel.fetchRepose()
        }
    }
}

}

Please do let me know what I am missing

Screenshot 2023-10-31 at 4 11 23 AM

Skip checkup error / Error: the file payload doesn't exist

Hey everyone, I want to share my problem and the solution. The command "skip checkup" was not passing all the tests/points, as you can see on the screenshot. I tried everything, from updating all the components like Xcode, dev tools, and command line tools, but nothing was working or helping. The main issue was that my terminal was running with Rosetta. To test this, you can run "brew config," and Rosetta 2 should be false. After removing the checkmark from running with Rosetta and reinstalling all the components, the "skip checkup" passed successfully.

screenshot

I've got macbook pro m1 2020 / macOS 14.3.1

Crash in release builds: java.lang.NullPointerException: null cannot be cast to non-null type skip.ui.PreferenceKeyCompanion<Value of skip.ui.Preference>

When the release Showcase.apk in the emulator that uses a PreferenceKey, crashes may occur like:

02-17 23:01:30.001  2470  2470 E AndroidRuntime: FATAL EXCEPTION: main
02-17 23:01:30.001  2470  2470 E AndroidRuntime: Process: skip.showcase.App, PID: 2470
02-17 23:01:30.001  2470  2470 E AndroidRuntime: java.lang.NullPointerException: null cannot be cast to non-null type skip.ui.PreferenceKeyCompanion<Value of skip.ui.Preference>
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at ra.e3.<init>(SourceFile:2)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at ra.e3.<init>(SourceFile:3)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at ra.u2$i.a(Unknown Source:765)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at ra.u2$i.p0(Unknown Source:10)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at s0.b.e(Unknown Source:49)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at s0.b.p0(Unknown Source:8)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at androidx.compose.material3.g2$d$a$a.a(Unknown Source:125)
02-17 23:01:30.001  2470  2470 E AndroidRuntime: 	at androidx.compose.material3.g2$d$a$a.q0(Unknown Source:8)

This is likely coming from PreferenceKey.swift:

self.initialValue = initialValue ?? (key.companionObjectInstance as! PreferenceKeyCompanion<Value>).defaultValue

This seems to be a consequence of the release build's proguard reduction. Changing the Android/app/proguard-rules.pro file to exclude skip classes makes the crash go away:

-keep class skip.** { *; }
-keep class showcase.module.** { *; }

However, it also increases the Showcase-release.apk size to 15.5 MB from 11.1 MB. Similarly, HelloSkip-release.apk jumps from 6.2 MB to 11 MB, which is an undesirable increase in minimum app size.

I suspect this is due to the way kotlin.reflect.full.companionObjectInstance works. I wonder if it would be possible to avoid using reflection to get the companion object, maybe by using @JvmStatic instead.

How To Retrofit my Existing App to Skip

Discussed in #52

Originally posted by davidakoontz November 20, 2023
Let's go beyond the Hello World (Skippers) App... By what general process would I start moving my existing app into a ... skip framework?

Step 1: Do I start from a blank project in Xcode? OR - (my best guess) start from the Hello-Skip app with the structure and working code.

Step 2: What can I file-copy over to the new (renamed - yeah how?) Hello-Skip app that has other dependencies...? I guess at some point it requires everything be copied.

Step 3: So then I try to compile in Xcode... and it kicks in the SkipStone Transpiler... something is going to break... What's the general guidance for fixing / ignoring / redesigning...

Surely you have more advice to give along this topic...

What to do first...

What to do last or much later...

What is not (YET) going to work...

For example - SF Symbols... Colors... Fonts... etc.

Maybe you could explain the deeper meaning behind your Module meaning. e.g. "Skip is designed to accommodate and encourage using multi-module projects." I'm just a simple App builder... no modules required. What might I benefit from?

gradle command failed on HelloSkip

Couldn't succeed to compile. It stops in the script to build gradle

"The gradle command failed."

Detail log below:

GRADLE> Could not determine the dependencies of task ':app:packageDebug'.
GRADLE> > Could not create task ':app:compileDebugJavaWithJavac'.
GRADLE> > Failed to calculate the value of task ':app:compileDebugJavaWithJavac' property 'javaCompiler'.
GRADLE> > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=17, vendor=any, implementation=vendor-specific} for MAC_OS on aarch64.
GRADLE> > No locally installed toolchains match and toolchain download repositories have not been configured.
GRADLE>
GRADLE> * Try:
GRADLE> > Learn more about toolchain auto-detection at https://docs.gradle.org/8.6/userguide/toolchains.html#sec:auto_detection.
GRADLE> > Learn more about toolchain repositories at https://docs.gradle.org/8.6/userguide/toolchains.html#sub:download_repositories.
GRADLE> > Run with --stacktrace option to get the stack trace.
GRADLE> > Run with --info or --debug option to get more log output.
GRADLE> > Run with --scan to get full insights.
GRADLE> > Get more help at https://help.gradle.org.

[✓] Skip version 0.8.8 (= 0.8.8)
[✓] macOS version 14.3.1 (> 13.5.0)
[✓] Swift version 5.9.2 (> 5.9.0)
[✓] Xcode version 15.2 (> 15.0.0)
[✓] Xcode tools SDKs: 5
[✓] Homebrew version 4.2.8 (> 4.1.0)
[✓] Gradle version 8.6 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2023.1
[✓] Android SDK licenses: 2
[✓] Resolve dependencies (19.71s)
[✓] Build hello-skip (10.13s)
[✓] Test Swift (6.17s)
[✓] Test Kotlin (22.96s)
[✓] Archive iOS ipa (25.96s)
[✓] Assemble HelloSkip-release.ipa (0.01s)
[✓] Verify HelloSkip-release.ipa 24 KB
[✓] Assembling Android apk (57.41s)
[✓] Verify HelloSkip-release.apk 6.2 MB
[✓] Check Swift Package (0.5s)
[✓] Skip 0.8.8 checkup (143.67s)

Error while building at first install

Error while building at first install:

The expected gradle folder did not exist, which may mean the Skip transpiler is not enabled or encountered errors. Try running `skip doctor` to diagnose and re-building the project. See https://skip.tools/docs/. Missing path: ~/Library/Developer/Xcode/DerivedData/SkipTour-afstayrnnummvzgvfbhngngipjkd/SourcePackages/plugins/Playing.output/SkipTour/skipstone/SkipTour

Skip Checkup is failing

fatal: unable to access 'https://source.skip.tools/skip-ui.git/': Could not resolve host: source.skip.tools

skip checkup

Output:
[✓] macOS version 13.6.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0 (= 15.0.0)
[✓] Homebrew version 4.1.18 (> 4.1.0)
[✓] Java version 17.0.7 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Create project hello-skip (18.57s)
[✗] Resolve dependencies (122.39s)
[✗] Build hello-skip (137.28s)
[⢯] Build hello-skip: fatal: unable to access 'https://source.skip.tools/skip-ui.git/': Could not resolve host: source.skip.tools

Synthesized PackageSupport.kt for a test package is overridden by the source package leading to missing Bundle.module

The PackageSupport.kt file contains package-specific functionality, such as the Bundle.module accessor and named tuple property accessors. When both a source module and the corresponding test module generate their PackageSupport.kt support files, the source's support code will override the test's. This can lead a runtime error about missing Bundle.module or missing tuple accessors.

This only occurs for Android testing, not on Robolectric. The reason is that Robolectric runs tests on the local JVM against the direct file system, so the classloader can handle multiple same-named resources in different locations. However when running against Android, all the modules are bundled together into a single .apk file, which only permits a file at a given path.

For example the SkipUI/src/main/kotlin/skip/ui/PackageSupport.kt contains:

package skip.ui

import skip.lib.*


internal val <E0, E1> Tuple2<E0, E1>.fromIndex: E0
    get() = element0

internal val <E0, E1> Tuple2<E0, E1>.toIndex: E1
    get() = element1

internal val <E0, E1, E2> Tuple3<E0, E1, E2>.x: E0
    get() = element0

internal val <E0, E1, E2> Tuple3<E0, E1, E2>.y: E1
    get() = element1

internal val <E0, E1, E2> Tuple3<E0, E1, E2>.z: E2
    get() = element2

whereas the SkipUI/src/test/kotlin/skip/ui/PackageSupport.kt file contains:

package skip.ui

import skip.lib.*


internal val skip.foundation.Bundle.Companion.module: skip.foundation.Bundle
    get() = skip.foundation.Bundle(_ModuleBundleLocator::class)
internal class _ModuleBundleLocator {}

When running the SkipUI tests on Android, the test's PackageSupport is overridden by that of the source package, and Bundle.module cannot be found with the error:

skip.ui.SkipUITests > testLocalizedText$SkipUI_debugAndroidTest[Pixel_6_API_33(AVD) - 13] �[31mFAILED �[0m
	java.lang.NoSuchMethodError: No static method getModule(Lskip/foundation/Bundle$Companion;)Lskip/foundation/Bundle; in class Lskip/ui/PackageSupportKt; or its super classes (declaration of 'skip.ui.PackageSupportKt' appears in /data/app/~~fjNm2UV8F_xGX6eB3NKBxA==/skip.ui.test-j1sgEbgQZxlDoyR0KOnVbA==/base.apk!classes2.dex)
	at skip.ui.SkipUITests$testLocalizedText$1$1.invoke(SkipUITests.kt:361)

The easiest solution might be to just generate a different file name (e.g., PackageSupportTest.kt instead of PackageSupport.kt) when the transpiled package is a test package, which will allow the two support files to co-exist when packaged into an .apk.

A string with a single interpolation is not inferred as ExpressibleByStringInterpolation

The string "A\(x)Z" can be used as an ExpressibleByStringInterpolation, but the string with just a single interpolation like "\(x)" cannot.

See the test case at skiptools/skip-lib@f1d42cf

Two adjacent string interpolations:

        XCTAssertEqual("stringstring", intepolate("\("string")\("string")"))

will be transpiled to the Kotlin:

        XCTAssertEqual("stringstring", intepolate({
            val str = StringExpressibleExample.StringInterpolationExample(literalCapacity = 0, interpolationCount = 0)
            str.appendInterpolation("string")
            str.appendInterpolation("string")
            StringExpressibleExample(stringInterpolation = str)
        }()))

But the single string interpolation:

        XCTAssertEqual("string", intepolate("\("string")"))

does not handle interpolation:

        XCTAssertEqual("string", intepolate("${"string"}"))

Add license

Add license for the project.
I would like to work on this.

@Binding keypath broken in recent releases

I am now receiving errors when referencing a binding property using key paths. It throws an error in Kotlin, Unresolved reference: name for the line with TextField in the example below. I went back to run things against a couple versions of skip, and I was able to verify things work fine up until (and including) version 0.7.31, and began erroring from version 0.7.32 onward.

Basic example:

struct Item {
    var name: String
}

public struct ContentView: View {
    @State var item: Item = Item(name: "New Item")
    
    public var body: some View {
        BindingView(item: $item)
    }
}


public struct BindingView: View {
    @Binding var item: Item
    
    public var body: some View {
        Section {
            HStack {
                TextField("", text: $item.name)
            }
        }
    }
}

Errors when running `skip checkup` if java version > 17

Error after first installation via brew and running skip checkup (with and without --double-check)

Maybe we can provide more info, to help resolving this issue?


Discussed in #4

Originally posted by oluarry October 27, 2023
This error came up when trying to build in xcode
I followed all the steps and made 2 different projects but same error in xcode
I ran skip doublecheck here
Screenshot 2023-10-26 at 11 18 07 PM

Error when running skip checkup

I tried running brew install skiptools/skip/skip and it installed successfully but when I run skip checkup, issue occured.

Please see logs when running skip checkup -v

xcodebuild: error: The project named "HelloSkip" does not contain a scheme named "HelloSkipApp". The "-list" option can be used to find the names of the schemes in the project. [✗] Archive iOS ipa (16.93s) Error: The file “Payload” doesn’t exist.

09_28_08

09_29_02

Xcode 15.0.1
iOS 17.0 is downloaded

How to remove trailiing "App" name from project

Recently found and installed SkipTools and I am already loving it! You guys rock and this is awesome!

However, as I run the application for testing I notice that on the simulators, the app launches with the name "MyExampleApp" when I just want to have it launch with "MyExample" I have looked through the documentation and have removed any indication of where this could be. I have looked around in the info.plist and the one section that I am finding is to change the name here:

Targets > Build Settings > Project Name:

Changing from "MyExampleApp" to "MyExample" produces build errors. I have even tried creating new schemes and to no resolve.

It continuously says that I have derived data builds, however I have completely deleted my entire derived data cache. Attached is a screenshot of the error

Screenshot 2023-11-03 at 10 44 10 AM

Any help would be greatly appreciated!

Cannot use CodingKey named "value"

The following swift:

public struct ValueHolder: Decodable {
    public let x: Int
    public let value: String?
    public let z: Bool
}

transpiles into the kotlin:

class ValueHolder: Decodable {
    val x: Int
    val value: String?
    val z: Boolean

    constructor(x: Int, value: String? = null, z: Boolean) {
        this.x = x
        this.value = value
        this.z = z
    }

    private enum class CodingKeys(override val rawValue: String, @Suppress("UNUSED_PARAMETER") unusedp: Nothing? = null): CodingKey, RawRepresentable<String> {
        x("x"),
        value("value"),
        z("z");
    }

    private fun CodingKeys(rawValue: String): CodingKeys? {
        return when (rawValue) {
            "x" -> CodingKeys.x
            "value" -> CodingKeys.value
            "z" -> CodingKeys.z
            else -> null
        }
    }

    constructor(from: Decoder) {
        val container = from.container(keyedBy = CodingKeys::class)
        this.x = container.decode(Int::class, forKey = CodingKeys.x)
        this.value = container.decodeIfPresent(String::class, forKey = CodingKeys.value)
        this.z = container.decode(Boolean::class, forKey = CodingKeys.z)
    }

    companion object: DecodableCompanion<ValueHolder> {
        override fun init(from: Decoder): ValueHolder = ValueHolder(from = from)
    }
}

and yields the (rather inscrutable) compile error:

GRADLE> e: file://…Tests.kt:270:16 Expecting ';' after the last enum entry or '}' to close enum class body
GRADLE> e: file://…Tests.kt:271:14 Expecting member declaration
GRADLE> e: file://…Tests.kt:271:15 Expecting member declaration
GRADLE> e: file://…Tests.kt:271:16 Expecting member declaration
GRADLE> e: file://…Tests.kt:271:21 Expecting member declaration
GRADLE> e: file://…Tests.kt:271:22 Expecting member declaration
GRADLE> e: file://…Tests.kt:271:23 Expecting member declaration
GRADLE> e: file://…Tests.kt:272:9 Expecting member declaration
GRADLE> e: file://…Tests.kt:272:10 Expecting member declaration
GRADLE> e: file://…Tests.kt:272:11 Expecting member declaration
GRADLE> e: file://…Tests.kt:272:12 Expecting member declaration
GRADLE> e: file://…Tests.kt:272:13 Expecting member declaration
GRADLE> e: file://…Tests.kt:272:14 Expecting member declaration
GRADLE> e: file://…Tests.kt:278:35 Unresolved reference: value
GRADLE> e: file://…Tests.kt:279:31 Unresolved reference: z
GRADLE> e: file://…Tests.kt:287:83 Unresolved reference: value
GRADLE> e: file://…Tests.kt:288:71 Unresolved reference: z
GRADLE> 
GRADLE> FAILURE: Build failed with an exception.

The workaround is to rename the value property to something else and assign the corresponding CodingKey to the name back to "value", like so:

public struct ValueHolder: Decodable {
    public let x: Int
    private let _value: String?
    public var value: String? { _value }
    public let z: Bool


    public enum CodingKeys : String, CodingKey {
        case x
        case _value = "value"
        case z
    }
}

Gradle run error: Optional(SkipDriveExternal.ProcessResult.ExitStatus.terminated(code: 1))

Prerequisites:

  • Mac mini 2018 Intel
  • Xcode Version 15.0.1 (15A507)
  • Android Studio Giraffe | 2022.3.1 Patch 2
  • Apple Swift version 5.9
  • java version "17.0.9" 2023-10-17 LTS
  • Kotlin version 1.9.10-release-459 (JRE 21.0.1)
  • Xcode and AndroidStudio installed in application folder

Skip Doctor

[✓] Skip version 0.7.16 (= 0.7.16)
[✓] macOS version 14.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.1.18 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Check Skip Updates: 0.7.16
[✓] Skip (0.7.16) checks complete

But when I run skip checkup Kotlin fails:

[✓] Skip version 0.7.16 (= 0.7.16)
[✓] macOS version 14.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.1.18 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Create project hello-skip (5.06s)
[✓] Resolve dependencies (18.22s)
[✓] Build hello-skip (45.23s)
[✓] Test Swift (19.59s)
[✗] Test Kotlin (28.74s)
[✓] Archive iOS ipa (35.74s)
[✓] Assemble HelloSkip-release.ipa (0.03s)
[✓] Verify HelloSkip-release.ipa 23 KB
[✗] Assembling Android apk (4.73s)
[✗] Verify HelloSkip-release.apk: The file “HelloSkip-release-unsigned.apk” couldn’t be opened because there is no such file.
[✗] Skip 0.7.16 checkup (158.55s)
Error: 4 errors

Just for test I init new skip xcode project and try to build it, get this error message:
Gradle run error: Optional(SkipDriveExternal.ProcessResult.ExitStatus.terminated(code: 1))

What I am doing wrong? Thank for the answer.

One-line function call on optional value yields Kotlin compile error: Type mismatch: inferred type is Unit? but Unit was expected

If a Void function has a single-line that invokes another Void function, we transpile it into a single line like: fun x(): Unit = f(), but that raises a compile error because f() returns Unit?.

For example, the Swift:

class Thing {
    var t: Thing? = nil

    init() {
    }

    func go() {
    }

    func optionalCall() {
        t?.go()
    }
}

transpiles into the Kotlin:

internal open class Thing {
    internal open var t: Thing? = null

    internal constructor() {
    }

    internal open fun go() = Unit

    internal open fun optionalCall(): Unit = t?.go()
}

which yields the compile error:

Type mismatch: inferred type is Unit? but Unit was expected

The only workaround is to add another line to the function, like:

    func optionalCall() {
        let x = t?.go()
        _ = x
    }

Error

I have latest xcode 15, java jdk 8 installed.

[✓] Skip version 0.7.14 (= 0.7.14)
[✓] macOS version 14.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✗] Xcode version: error executing xcodebuild
[✓] Homebrew version 4.1.17 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✗] Java version could not extract version from java
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✗] Create project hello-skip (0.06s)

Running `brew install skiptools/skip/skip` installs version 0.7.9 instead of the newest version

Steps to reproduce:

  1. Install skip using homebrew
  2. Check skip version
➜  Repos brew install skiptools/skip/skip
Warning: Not upgrading skip, the latest version is already installed
➜  Repos skip --help
OVERVIEW: skip 0.7.9

USAGE: skip <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  version                 Print the skip version
  doctor                  Evaluate and diagnose Skip development environment
  checkup                 Run tests to ensure Skip is in working order
  upgrade                 Upgrade to the latest Skip version using Homebrew
  app                     Commands to manage application projects
  lib                     Commands to manage library projects
  init                    Initialize a new Skip library project
  verify                  Verify the Skip project
  test                    Run parity tests and generate reports

  See 'skip help <subcommand>' for detailed help.

Expected result:
Version 0.7.13 to be installed.

Actual result:
Version 0.7.9 is installed.

SwiftUI previews do not work when Skip is enabled

The Xcode preview canvas for a SwiftUI view does not currently work when Skip is enabled in an app project.

For example, adding the following to the default Hello app will fail to build the preview:

#Preview {
    ContentView()
}

The error in the "Build for Previews HelloSkip" log is:

Showing All Messages
PhaseScriptExecution Run\ skip\ gradle /Users/marc/Library/Developer/Xcode/DerivedData/Skip-Everything-aqywrhrzhkbvfseiqgxuufbdwdft/Build/Intermediates.noindex/Previews/HelloSkip/Intermediates.noindex/HelloSkip.build/Debug-iphonesimulator/HelloSkip.build/Script-499CD4452AC5B869001AE8D8.sh (in target 'HelloSkip' from project 'HelloSkip')
    cd /opt/src/github/skiptools/skipapp-hello/Darwin
    /bin/sh -c /Users/marc/Library/Developer/Xcode/DerivedData/Skip-Everything-aqywrhrzhkbvfseiqgxuufbdwdft/Build/Intermediates.noindex/Previews/HelloSkip/Intermediates.noindex/HelloSkip.build/Debug-iphonesimulator/HelloSkip.build/Script-499CD4452AC5B869001AE8D8.sh

note: running gradle build with: /Users/marc/Library/Developer/Xcode/DerivedData/Skip-Everything-aqywrhrzhkbvfseiqgxuufbdwdft/Build/Intermediates.noindex/Previews/HelloSkip/Products/Debug/skip gradle -p /opt/src/github/skiptools/skipapp-hello/Darwin/../Android launchDebug
Error: Gradle run error: Optional(SkipDriveExternal.ProcessResult.ExitStatus.terminated(code: 1))
execGradle: /opt/homebrew/bin/gradle -p ../Android launchDebug --warning-mode all --console=plain
GRADLE> 
GRADLE> FAILURE: Build failed with an exception.
GRADLE> 
GRADLE> * What went wrong:
GRADLE> Skip output directory does not exist at: /Users/marc/Library/Developer/Xcode/DerivedData/Skip-Everything-aqywrhrzhkbvfseiqgxuufbdwdft/Build/Intermediates.noindex/Previews/HelloSkip/Products/Debug-iphonesimulator/../../../SourcePackages/plugins/skipapp-hello.output/HelloSkip/skipstone
GRADLE> 
GRADLE> * Try:
GRADLE> > Run with --stacktrace option to get the stack trace.
GRADLE> > Run with --info or --debug option to get more log output.
GRADLE> > Run with --scan to get full insights.
GRADLE> > Get more help at https://help.gradle.org.
GRADLE> 
GRADLE> BUILD FAILED in 330ms

running gradle build with: /Users/marc/Library/Developer/Xcode/DerivedData/Skip-Everything-aqywrhrzhkbvfseiqgxuufbdwdft/Build/Intermediates.noindex/Previews/HelloSkip/Products/Debug/skip gradle -p /opt/src/github/skiptools/skipapp-hello/Darwin/../Android launchDebug

Gradle FAILED: 

Gradle run error: Optional(SkipDriveExternal.ProcessResult.ExitStatus.terminated(code: 1))

skip checkup - could not find or install Android Studio. Command line install worked.

I had this issue when running skip checkup.

  • Ran skip checkup multiple times and it could not find Android Studio (even though it was installed) and tried to install it.
  • uninstalled Android Studio using Jetbrains Toolbox
  • ran skip checkup and it did not find Android Studio
  • successfully ran brew install android-studio from command line(see log)
  • successfully ran skip checkup

[✓] Skip version 0.7.45 (= 0.7.45)
[✓] macOS version 14.2.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.2.3 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[!] Android Studio not found: brew install android-studio
[✓] Resolve dependencies (6.02s)
[✓] Build hello-skip (13.08s)
[✓] Test Swift (9.15s)
[✓] Test Kotlin (17.17s)
[✓] Archive iOS ipa (11.01s)
[✓] Assemble HelloSkip-release.ipa (0.01s)
[✓] Verify HelloSkip-release.ipa 23 KB
[✓] Assembling Android apk (35.11s)
[✓] Verify HelloSkip-release.apk 6.2 MB
[✓] Check Swift Package (0.49s)
[!] Skip 0.7.45 checkup (92.7s)

brew install android-studio
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##################################################################################### 100.0%
==> Downloading https://redirector.gvt1.com/edgedl/android/studio/install/2023.1.1.27/androi
==> Downloading from https://r4---sn-o097znzr.gvt1.com/edgedl/android/studio/install/2023.1.
##################################################################################### 100.0%
==> Installing Cask android-studio
==> Moving App 'Android Studio.app' to '/Applications/Android Studio.app'
==> Linking Binary 'studio' to '/opt/homebrew/bin/studio'
🍺 android-studio was successfully installed!

[✓] Skip version 0.7.45 (= 0.7.45)
[✓] macOS version 14.2.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.2.3 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2023.1
[✓] Resolve dependencies (6.15s)
[✓] Build hello-skip (12.77s)
[✓] Test Swift (8.64s)
[✓] Test Kotlin (17.18s)
[⣦] Archive iOS ipa: Fetching from https://source.skip.tools/skip-unit.git (cached)

Conforming to a generic type with associated type error: Type parameter ID of 'Identifiable' has inconsistent values: Long, [Error type: Unresolved type for ID]

The swift:

protocol SQLRow : Identifiable {
}

public struct DataItem : Identifiable {
    public typealias ID = Int64
    public let id: ID
    public init(id: ID) {
        self.id = id
    }
}

extension DataItem : SQLRow {
}

transpiles to the Kotlin:

class DataItem: Identifiable<Long>, SQLRow<ID>, MutableStruct {
    override val id: Long
}

internal interface SQLRow<ID>: Identifiable<ID> {
}

Which fails to compile:

Type parameter ID of 'Identifiable' has inconsistent values: Long, [Error type: Unresolved type for ID]
Screenshot 2023-11-18 at 09 40 21

skip checkup error

[✓] Skip version 0.8.15 (= 0.8.15)
[✓] macOS version 14.3 (> 13.5.0)
[✓] Swift version 5.9.2 (> 5.9.0)
[✓] Xcode version 15.2 (> 15.0.0)
[✓] Xcode tools SDKs: 5
[✓] Homebrew version 4.2.9 (> 4.1.0)
[✓] Gradle version 8.6 (= 8.6.0)
[✓] Java version 21.0.2 (> 21.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2023.1
[✓] Android tools SDKs: 7
[✓] Resolve dependencies (14.4s)
[✓] Build hello-skip (12.65s)
[✓] Test Swift (6.96s)
[✓] Test Kotlin (35.52s)
[✓] Archive iOS ipa (22.55s)
[✓] Assemble HelloSkip-release.ipa (0.01s)
[✓] Verify HelloSkip-release.ipa 24 KB
[✗] Assembling Android apk (28.39s)
[✗] Verify HelloSkip-release.apk: The file “app-release-unsigned.apk” couldn’t be opened because there is no such file.
[✓] Check Swift Package (0.4s)
[✗] Skip 0.8.15 checkup fail (log: /tmp/skip-checkup-.txt)
See https://skip.tools/docs/faq and https://community.skip.tools for resolution
Error: 3 errors

skip checkup passes, but building projects fails with Gradle run error

Discussed in #74

Originally posted by Wheels00 December 28, 2023
skip checkup --double-check passes just fine (screenshot below)

I have downloaded the SkipWeather example, and I am trying to run it in both simulators. Build fails with this error:

Screenshot 2023-12-28 at 5 18 37 pm

Any suggestions?

[Update: Same error on new projects built with skip init]

Screenshot 2023-12-28 at 5 28 24 pm

ExpressibleByStringInterpolation constructor is not inferred for non-interpolated string parameters

This is related to #64 . We want to be able to implement SkipUI.Text like so:

public struct Text {
    public init(_ key: LocalizedStringKey, tableName: String? = nil, bundle: Bundle? = nil, comment: StaticString? = nil) {
        
    }

    public init(verbatim string: String) {
        
    }
}

And be able to create the Text with a localized key. When the string contains an interpolation (e.g., Text("Name: \(username)"), then the LocalizedStringKey constructor is inferred correctly. But if just do Text("Name") with no interpolated arguments, the string sent to the String(verbatim:) constructor, which is not what we want.

The workaround is to explicitly use a LocalizedStringKey in the Text initializer, as seen at https://github.com/skiptools/skip-ui/blob/main/Tests/SkipUITests/SkipUITests.swift#L320

Kotlin test failed despite being installed

I have an issue with the HelloSkip base project. I'm unable to compile anything.

skip doctor yields no problems

Skip Doctor
[✓] Skip version 0.7.14 (= 0.7.14)
[✓] macOS version 14.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.1.17 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Check Skip Updates: 0.7.14
[✓] Skip (0.7.14) checks complete

however, skip checkup :

[✓] Skip version 0.7.14 (= 0.7.14)
[✓] macOS version 14.1 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.1.17 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Create project hello-skip (1.1s)
[✓] Resolve dependencies (10.45s)
[✓] Build hello-skip (14.23s)
[✓] Test Swift (8.97s)
[✗] Test Kotlin (2.57s)
[✓] Archive iOS ipa (16.49s)
[✓] Assemble HelloSkip-release.ipa (0.01s)
[✓] Verify HelloSkip-release.ipa 23 KB
[✗] Assembling Android apk (0.64s)
[✗] Verify HelloSkip-release.apk: The file “HelloSkip-release-unsigned.apk” couldn’t be opened because there is no such file.
[✗] Skip 0.7.14 checkup (55.6s)
Error: 4 errors

I have Android Studio installed and I'm having no problems compiling and running apps in it.
Additionally I have downgraded JDK from temurin-21 to openjdk17 as suggested in the other post.
I also installed kotlin on top of Android Studio using brew install kotlin but to no avail.

Finally, I tried running skip checkup --verbose to get some insight, but nothing interesting seem to point that there is a problem with Kotlin. The log is huge, so I'm adding it as a separate file if it can help debugging. skip_checup.txt

Any suggestions?

How To Retrofit my Existing App to Skip

Discussed in #52

Originally posted by davidakoontz November 20, 2023
Let's go beyond the Hello World (Skippers) App... By what general process would I start moving my existing app into a ... skip framework?

Step 1: Do I start from a blank project in Xcode? OR - (my best guess) start from the Hello-Skip app with the structure and working code.

Step 2: What can I file-copy over to the new (renamed - yeah how?) Hello-Skip app that has other dependencies...? I guess at some point it requires everything be copied.

Step 3: So then I try to compile in Xcode... and it kicks in the SkipStone Transpiler... something is going to break... What's the general guidance for fixing / ignoring / redesigning...

Surely you have more advice to give along this topic...

What to do first...

What to do last or much later...

What is not (YET) going to work...

For example - SF Symbols... Colors... Fonts... etc.

Maybe you could explain the deeper meaning behind your Module meaning. e.g. "Skip is designed to accommodate and encourage using multi-module projects." I'm just a simple App builder... no modules required. What might I benefit from?

As they have not yet written but one page of Documentations ... maybe we first adopters are going to have to blaze this trail.
-- David

Error while setup/installation

skip checkup
[✓] Skip version 0.7.15 (= 0.7.15)
[✓] macOS version 14.0 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0 (= 15.0.0)
[✓] Homebrew version 4.1.17 (> 4.1.0)
[✗] Gradle version: error executing gradle
[✓] Java version 21.0.1 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Create project hello-skip (0.94s)
[✓] Resolve dependencies (22.78s)
[✓] Build hello-skip (27.78s)
[✓] Test Swift (16.39s)
[✗] Test Kotlin (1.48s)
[✓] Archive iOS ipa (35.66s)
[✓] Assemble HelloSkip-release.ipa (0.02s)
[✓] Verify HelloSkip-release.ipa 23 KB
[✗] Assembling Android apk (0.01s)
[✗] Verify HelloSkip-release.apk: The file “HelloSkip-release-unsigned.apk” couldn’t be opened because there is no such file.
[✗] Skip 0.7.15 checkup (106.03s)

but while use
JAVA_HOME= skip checkup
[✓] Skip version 0.7.15 (= 0.7.15)
[✓] macOS version 14.0 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0 (= 15.0.0)
[✓] Homebrew version 4.1.17 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 21.0.1 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Create project hello-skip (0.93s)
[✓] Resolve dependencies (23.83s)
[✓] Build hello-skip (25.94s)
[✓] Test Swift (16.07s)
[✗] Test Kotlin (5.51s)
[✓] Archive iOS ipa (34.92s)
[✓] Assemble HelloSkip-release.ipa (0.02s)
[✓] Verify HelloSkip-release.ipa 23 KB
[✗] Assembling Android apk (1.28s)
[✗] Verify HelloSkip-release.apk: The file “HelloSkip-release-unsigned.apk” couldn’t be opened because there is no such file.
[✗] Skip 0.7.15 checkup (109.95s)

NavigationStack adds "padding" to android top screen

I'm begining in skip development. I've created a simple login view with NavigationStack to go between my views.
The problem is that when I have the navigationStack enabled, when I build the application on the android simulator there is a "padding" on top of the screen before my view is displayed:
image

The only solution I've found is to remove my navigationStack to make the view taking all the android screen.

For more context, here is my Content View code (the login and signup views are almost the same, they just have some spacers and the fields):
`public struct ContentView: View {
@State var status: String = "login"

public init() {
}

public var body: some View {
    NavigationStack {
        switch status {
        case "login":
            LoginView(status: $status)
        
        case "signup":
            SignupView(status: $status)
            
        default:
            Text("User logged in...")
                .navigationTitle("Home")
                .background(.blue)
        }
    }
}

}`

I also noticed that if there is multiple NavigationStack (like one in the ContentView and then one in the LoginView) the top spacing is even bigger (like if they add themselves).

Is there a way to get rid of this space ?

Unable to build the new boilerplate project on Xcode

Installation and all the setup was successful but when I try to build the project on Xcode it shows this error and I see no details about the error If I click it.

Command PhaseScriptExecution failed with a nonzero exit code

Unwrapped inout parameter is treated as optional in Kotlin

When an inout parameter holds an optional value, accessing the value in an if let statement doesn't treat it as being unwrapped on the Kotlin side:

    /// Prepares the given SQL statement, caching and re-using it into the given statement handle.
    func prepare(sql: String, into statement: inout SQLStatement?) throws -> SQLStatement {
        if let stmnt = statement {
            return stmnt // already cached
        } else {
            let stmnt = try ctx.prepare(sql: sql)
            statement = stmnt // save to the cache
            return stmnt
        }
    }

The Kotlin compile error is:

Type mismatch: inferred type is SQLStatement? but SQLStatement was expected

The generated Kotlin looks like this:

    internal open fun prepare(sql: String, into: InOut<SQLStatement?>): SQLStatement {
        val statement = into
        if (statement.value != null) {
            val stmnt = statement.value
            return stmnt // already cached
        } else {
            val stmnt = ctx.prepare(sql = sql)
            statement.value = stmnt // save to the cache
            return stmnt
        }
    }

The workaround is to force-unwrap the inout on the Kotlin side:

    /// Prepares the given SQL statement, caching and re-using it into the given statement handle.
    func prepare(sql: String, into statement: inout SQLStatement?) throws -> SQLStatement {
        if let stmnt = statement {
            #if SKIP
            return stmnt! // Skip treats this as an optional
            #else
            return stmnt // already cached
            #endif
        } else {
            let stmnt = try ctx.prepare(sql: sql)
            statement = stmnt // save to the cache
            return stmnt
        }
    }
Screenshot 2023-11-19 at 17 31 42

[!] Android Studio not found: brew install android-studio

I'm using Jetbrains Toolbox to install/upgrade android studio, when I ran command skip checkup it said [!] Android Studio not found: brew install android-studio.

Is it possible for a Jetbrains Toolbox user to pass the skip checkup or install Android Studio via home-brew is required?

Xcode Internal inconsistency error when running Skip plugin

When building a project with the Skip plugin, the following Xcode errors can occur and halt the build:

Internal inconsistency error: received multiple target ended messages for target ID '6' or received target ended message but did not receive corresponding target started message, while retrieving parent activity in taskStarted message.
Internal inconsistency error: received multiple task ended messages for task ID '8' or received task ended message but did not receive corresponding task started message.

Performing a clean re-build is the only way to work around this. Sometimes this needs to be done multiple times.

There is no obvious trigger for this error – it occurs at random when building a project. I suspect it has to do with Xcode running multiple simultaneous plugins invocations (for all the dependent Skip modules), and having their communication pipelines mixed up somehow. However, since Xcode 15 removed the ability to disable the "Parallelize Build" setting for the scheme, it is not possible to test this hypothesis directly.

This issue is reported by other SPM plugins when run from within Xcode (e.g., SwiftGen/SwiftGenPlugin#15), and has been a bug since Xcode 14.3, and persists through 15.1. See apple/swift-package-manager#6705.

Mutating enum self

This may be impossible to get around, but technically structs and enums in Swift work the same way, but it looks like trying to mutate an enum instance doesn't work. The following gives me the error "Variable expected" for "this =". I believe it is because the enum is not adopting MutatingStruct.

enum Count {
    case one
    case two
    case three
    
    mutating func reset() {
        self = .one
    }
}

I can run Skip because gradle command failed when i open in Android Studio works fine but in XCode doesn't work....

The gradle command failed. Review the log for details and consult https://skip.tools/docs/faq for common solutions. Command: gradle -p ../Android launchDebug.

[✓] Skip version 0.7.55 (= 0.7.55)
[✓] macOS version 14.0 (> 13.5.0)
[✓] Swift version 5.9.2 (> 5.9.0)
[✓] Xcode version 15.2 (> 15.0.0)
[✓] Xcode tools SDKs: 8
[✓] Homebrew version 4.2.6 (> 4.1.0)
[✓] Gradle version 8.4 (> 8.3.0)
[✓] Java version 17.0.9 (> 17.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2023.1
[✓] Android SDK licenses: 7
[✓] Resolve dependencies (11.17s)
[✓] Build hello-skip (15.77s)
[✓] Test Swift (9.19s)
[✓] Test Kotlin (45.74s)
[✓] Archive iOS ipa (27.08s)
[✓] Assemble HelloSkip-release.ipa (0.02s)
[✓] Verify HelloSkip-release.ipa 24 KB
[⡇] Verify HelloSkip-release.apk: /var/folders/f_/5fy7swmj27n__2dwqpqr8lqc0000gn/T//82C0BDE7-3F82-41B4-997F-3AD522AA1750/hello-skip/.build/Android/app/outputs/apk/release/app-release-unsigned.apk[✓] Assembling Android apk (101.14s)
[✓] Verify HelloSkip-release.apk 6,2 MB
[✓] Check Swift Package (1.87s)
[✓] Skip 0.7.55 checkup (215.11s)

results of skip checkup.

check error

macos sonoma, m1 pro

[✓] Skip version 0.7.16 (= 0.7.16)
[✓] macOS version 14.0 (> 13.5.0)
[✓] Swift version 5.9 (= 5.9.0)
[✓] Xcode version 15.0.1 (> 15.0.0)
[✓] Homebrew version 4.1.18 (> 4.1.0)
[✗] Gradle version: error executing gradle
[✗] Java version: error executing java
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2022.3
[✓] Create project hello-skip (0.43s)
[✓] Resolve dependencies (20.6s)
[✓] Build hello-skip (16.9s)
[✓] Test Swift (10.99s)
[✗] Test Kotlin (0.61s)
[✓] Archive iOS ipa (32.55s)
[✓] Assemble HelloSkip-release.ipa (0.01s)
[✓] Verify HelloSkip-release.ipa 23 KB
[✗] Assembling Android apk (0.01s)
[✗] Verify HelloSkip-release.apk: The file “HelloSkip-release-unsigned.apk” couldn’t be opened because there is no such file.
[✗] Skip 0.7.16 checkup (82.71s)
Error: 6 errors

Not able to build after skit init

I'm not able to build for some reason, checkup all good, init ok, I clean build folder and deleted derived data but same issue persist

image

Command PhaseScriptExecution failed with a nonzero exit code - SkipStone plugin missing output

Hello team,
I have an issue on the build of the HelloSkip example project.
I followed your Readme and the skip checkup seems to be ok.

The problem seems to coming from the SkipStone plugin. I trusted the plugin in Xcode but on build the SkipStone output seems to missing.
My ~/.skiptools/skipkey.env file have a valid license key & the Android simulator is launched.

Project init:
Capture d’écran 2024-01-19 à 10 24 54

Skip checkup:
Capture d’écran 2024-01-19 à 10 25 08

On build, I always have this error, even with the Showcase example app:
Capture d’écran 2024-01-19 à 10 37 25

Do you have some recommandations for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.