Hi everyone! I am going threw this <tutorial on KM...
# touchlab-tools
p
Hi everyone! I am going threw this tutorial on KMMBridge and can’t get the SPM dependency to work. I have a private Github repo. I created an .netrc file and filled it with my login and a new PAT. When I try to add a package I paste the github link into a search box and for some reason Xcode does not use the .netrc file and asks to provide a creadentials. But this also does not work. What am I doing wrong?
Screen Shot 2023-01-31 at 16.44.25.png
k
Sorry, had typed a reply in the other thread but never sent I guess…
My guess is the PAT doesn’t have whatever permissions Xcode needs. I think because anybody on our team doing docs had already authed Xcode, we never created a PAT for that.
That does look like Xcode is telling you that you can’t access that repo.
I get the same pop up if I use a PAT without the necessary permissions
Screen Shot 2023-02-01 at 8.01.49 AM.png,Screen Shot 2023-02-01 at 7.59.30 AM.png
In this case I left off “repo”.
I replaced the PAT with another one with those 4 permissions and it works now.
p
Thanks a lot for answering! I am not sure what you mean by
In this case I left off “repo”.
You mean when creating a PAT leave repo unchecked? Like that?
k
I mean, when I created the PAT that failed, I left repo unchecked. When I mad a new one that worked, I had the 4 in that screenshot (
admin:public_key
,
write:discussion
,
repo
,
user
)
So, summary, I created a new PAT with those 4 permissions, and that PAT worked.
p
I have all of these checked, but it still won’t work
k
Then I’m not sure what’s wrong. It’s an Xcode -> Github issue. Something is wrong with permissions on the Github side would be my guess. I’d make sure you can clone that repo with that account and PAT. Also maybe check the Github panel in Xcode to make sure it’s not trying to use SSH.
p
Thanks. I will keep trying
Maybe that I don’t have some of the rights in repo itself? I am not the owner, but a contributor
k
I would guess that’s potentially the issue. I don’t know what Xcode needs to do with those permissions. I’ll add that to internal discussions. I would bet everybody that’s tested with our repos is a full member of the org with write or management permissions.
p
Just keeping you posted. Getting an admin rights to the repo does not solve the problem
k
Well, I’m not sure what’s next. This is an Xcode/GitHub problem that you would have outside of Kotlin, so I’m not really sure what to try. I assume this is a private repo for a reason, so I can’t really try it myself and I doubt I could get access 🙂
p
Tried via SSH and I got threw the Authentication successfully. Now I have a new problem. I get 401 when trying to download the package
k
Well, netrc uses the PAT, so if the PAT issues aren’t resolved, that’ll still be a problem. 401 is an auth issue, so…
p
Yeah - seems like it
@kpgalligan Hi. I am sorry for bothering you with so many questions. I finally managed to import a package. But I still can’t use it. When I try to import allShared it says that there is no such module. I noticed that in tutorial it shows you the allShared package in project navigator. I have KMMBridgeKickStart there and in it all the modules folders
The Package file for KMMBridgeKickStart looks like this: // swift-tools-version:5.3 import PackageDescription let remoteKotlinUrl = “https://maven.pkg.github.com/Lightricks/Feed-Multiplatform-Client/com/lightricks/kmp/allshared-kmmbridge/0.1.3/allshared-kmmbridge-0.1.3.ziplet remoteKotlinChecksum = “***” let packageName = “KMMBridgeKickStart” let package = Package( name: packageName, platforms: [ .iOS(.v13) ], products: [ .library( name: packageName, targets: [packageName] ), ], targets: [ .binaryTarget( name: packageName, url: remoteKotlinUrl, checksum: remoteKotlinChecksum ) , ] )
And the Package file for allShared is empty
a
@Pavel Dektev Did you solved this issue?
p
Hi @Anton Penkrat. No - I didn’t
a
@Pavel Dektev I added this at the end of kotlin { } block:
p
Should I add it too? What file it is?
In build.gradle of allShared module?
a
yes
p
What it does - renames all the apple frameworks to allShared?
a
Yep. After publish - you will need to reimport SPM in XCode
p
You think naming is the cause of the problem I have?
a
Problem i think is in gradle script that generate incorrect publication result. But it is better to owners to tell
p
I will try it out. Thanks
k
Some quick questions. This may be a bug in recent releases, but why is the package name
*let* packageName = "KMMBridgeKickStart"
. Was the config changed for
kmmbridge
in gradle? What does that look like? The package name and publishing name should be lower case, so if it’s
allShared
with a cap
S
that will at least upset GitHub packages.
If you’re getting this by following the steps, we’ll need to retry that and fix, as it should Just Work™️
a
We got this independently on each other. Should be easy to reproduce
k
I mean, we run integration tests and don’t have it, so can you give me more context?
If you’re just running the blog post steps, that’s context enough. If you’re integrating into production builds, there may be confounding factors.
a
Yes. I followed blog post steps for SPM
k
You're changing the framework name. What was it that you're changing from?
a
Package.swift contained this: let packageName = “KMMBridgeKickStart”
k
Ah, ok. That's definitely a bug then.
a
@Pavel Dektev Do not forget to add this:
p
Alright. AFK right now - will try it out on Sunday
Thank you guys! It workded
Definitely a bug introduced. Adding GitHub issues…
Thanks for the heads up and help narrowing down. Fix applied to the kickstart repo and issue in KMMBridge: https://github.com/touchlab/KMMBridge/issues/205