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

Error on Swift code on step3 #7

Open
hrqmonteiro opened this issue May 2, 2024 · 3 comments
Open

Error on Swift code on step3 #7

hrqmonteiro opened this issue May 2, 2024 · 3 comments

Comments

@hrqmonteiro
Copy link

import SwiftUI
import Shared

struct ContentView: View {
    let phrases = Greeting().greet()

    var body: some View {
        List(phrases, id: \.self) {
            Text($0)
        }
    }
}

This code returns these errors:

Cannot convert value of type 'String' to expected argument type 'Binding<Data>'
Initializer 'init(_:)' requires that 'Binding<Data.Element>' conform to 'StringProtocol'

Screenshot 2024-05-02 at 11 22 05 AM

@pahill
Copy link
Collaborator

pahill commented May 6, 2024

Hi there, thanks for taking the time to file this issue.

I think, it's possible that your shared framework is out of date. You can run embedAndSign to refresh this by either running the app from Android Studio or even Xcode.

Will you check and let me know please?

@hrqmonteiro
Copy link
Author

embedAndSign

I don't have the slightest idea of how to do that embedAndSign and i couldn't find anything about it, i am very new to Kotlin.
I am just following the tutorial word by word.

Can you provide me more info about it?

The screenshot i provided you was precisely when i tried to run it on Xcode. If i run it on Android Studio this is what i get:

Screenshot 2024-05-06 at 8 42 25 PM

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project /Users/hrq/Code/Learning/GreetingKMP/iosApp/iosApp.xcodeproj -scheme iosApp -configuration Debug OBJROOT=/Users/hrq/Code/Learning/GreetingKMP/build/ios SYMROOT=/Users/hrq/Code/Learning/GreetingKMP/build/ios -destination id=D9E05D56-CBCB-4F27-A291-9509F5BD345E -allowProvisioningDeviceRegistration -allowProvisioningUpdates

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    OBJROOT = /Users/hrq/Code/Learning/GreetingKMP/build/ios
    SYMROOT = /Users/hrq/Code/Learning/GreetingKMP/build/ios

Prepare packages

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (1 target)
    Target 'iosApp' in project 'iosApp' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription
Build description signature: fc300dfc2957b0d1adba3793526ee8cf
Build description path: /Users/hrq/Code/Learning/GreetingKMP/build/ios/XCBuildData/fc300dfc2957b0d1adba3793526ee8cf.xcbuilddata

/Users/hrq/Downloads/GreetingKMP/iosApp/Configuration/Config.xcconfig:1:1: error: unable to open configuration settings file
error: Multiple commands produce '/Users/hrq/Code/Learning/GreetingKMP/build/ios/Debug-iphonesimulator/.app'
    note: Target 'iosApp' (project 'iosApp') has create directory command with output '/Users/hrq/Code/Learning/GreetingKMP/build/ios/Debug-iphonesimulator/.app'
    note: Target 'iosApp' (project 'iosApp') has link command with output '/Users/hrq/Code/Learning/GreetingKMP/build/ios/Debug-iphonesimulator/.app'
warning: Run script build phase 'Compile Kotlin Framework' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'iosApp' from project 'iosApp')
error: failed to read asset tags: Error Domain=NSCocoaErrorDomain Code=4 "The file “iosApp” doesn’t exist." UserInfo={NSFilePath=/Users/hrq/Downloads/GreetingKMP/iosApp} (in target 'iosApp' from project 'iosApp')
warning: duplicate output file '/Users/hrq/Code/Learning/GreetingKMP/build/ios/Debug-iphonesimulator/.app' on task: Ld /Users/hrq/Code/Learning/GreetingKMP/build/ios/Debug-iphonesimulator/.app normal (in target 'iosApp' from project 'iosApp')
** BUILD FAILED **

@JavaGalaxy
Copy link

I am having similar issues.
the solution listed in the Getting Started Doc doesn't seem to help

Xcode may need to clear cached binaries: try resetting the environment by choosing Product | Clean Build Folder in the main menu.

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