Swift playgrounds (.swiftpm) and CoreML

Hey guys, I've been having difficulties transferring my Xcode project to a Swift playground (.swiftpm) for the Swift Student Challenge. I keep getting these errors as well as none of the views being able to find the model in scope:

"TrashDetector 1.mlmodel: No predominant language detected. Set COREML_CODEGEN_LANGUAGE to preferred language."

Unexpected duplicate tasks: Target 'TrashQuest' (project 'TrashQuest') has write command with output /Users/kmcph3/Library/Developer/Xcode/DerivedData/TrashQuest-glvzskunedgtakfrdmsxdoplondj/Build/Intermediates.noindex/TrashQuest.build/Debug-iphonesimulator/TrashQuest.build/0a4ef2429d66360920ddb4f16e65e233.sb

I've gone through multiple post with these exact problems, but they all seem to be talking about ".playground" files due to the "Resources" folder (mind you I did try exactly what they said). Is there anyone that can help???

(Quick side note, why does it need to be a swiftpm file for the SSC??? Like why can't we just send the zip of our Xcode project??)

Answered by KalynMcPhail in 826180022

Never mind guys, I figured it out. I compiled the model using Terminal, created resources and sources folders, and played around with the package.swift file, and eventually got it to work.

I'm also getting this duplicate tasks error: Target 'TrashQuest' (project 'TrashQuest'): CoreMLModelCompile /Users/kmcph3/Library/Developer/Xcode/DerivedData/TrashQuest-glvzskunedgtakfrdmsxdoplondj/Build/Products/Debug-iphonesimulator/TrashQuest.app/ /Users/kmcph3/Desktop/FinalTrashQuest/TrashQuest.swiftpm/TrashDetector 1.mlmodel

Accepted Answer

Never mind guys, I figured it out. I compiled the model using Terminal, created resources and sources folders, and played around with the package.swift file, and eventually got it to work.

Swift playgrounds (.swiftpm) and CoreML
 
 
Q