ARVideoKit icon indicating copy to clipboard operation
ARVideoKit copied to clipboard

Swift 4.1 can't use

Open v164237 opened this issue 6 years ago • 18 comments

I had updated the Xcode to 9.3 beta. It shows me the message "Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1".

v164237 avatar Mar 15 '18 07:03 v164237

Hey @v164237, are you using the binary (.framework) file?

-Ahmed

AFathi avatar Mar 19 '18 16:03 AFathi

Same here, not working on XCode 9.3 (not beta)

Vicapps avatar Apr 01 '18 10:04 Vicapps

@AFathi @v164237 same problem, can we just use source code now, since @AFathi has open sourced this project?

zyangSir avatar Apr 02 '18 03:04 zyangSir

Same issue for me. Any workaround for this? @AFathi

shashank-rps avatar Apr 02 '18 11:04 shashank-rps

@shashank-rps @v164237 @zyangSir @Vicapps,

I'd recommend using the source code rather than using the binary file (.framework file).

AFathi avatar Apr 02 '18 16:04 AFathi

FYI, you just need to rebuild the framework with target swift language and then import it :)

anushkmittal avatar Apr 11 '18 07:04 anushkmittal

working for me xcode9.3

anilios avatar Apr 12 '18 06:04 anilios

I'm a newbie coder and need some help here with how to "rebuild the framework with target swift language and then import it'. I've imported repository to Xcode, in Build Settings> Swift Compiler - Language, changed it to 4.1, build and ran that code. Then I went back into the RecordARKit-SpriteKit demo project, deleted the original ARVideoKit.framework file, dragged the 'new" .framework file into Embedded Binaries, copies the files, and am still getting the same error message [Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1]. What am I doing wrong?! I'm using Xcode 9.3.

jslusser avatar Apr 15 '18 15:04 jslusser

@anushkmittal can you list some steps on how to rebuild the framework?

allenwixted avatar Apr 20 '18 18:04 allenwixted

@allenwixted open the "ARVideoKit.xcodeproj" file and build it. Then go to products -> ARVideoKit.framework -> right click "show in finder" -> Import that framework into your project

LeonardRockstar avatar Apr 21 '18 02:04 LeonardRockstar

@LeonardRockstar thanks for those detailed instructions. Have followed them on Version 9.4 beta (9Q1004a) but am still in the same situation. Has me stumped. Should I be doing anything else as a pre-requisite? Is it possible that the repo could be updated to support 4.1?

Edit: Changed ARVideoKit Project to deploy to iOS 11 only and now it works. @jslusser this may be of interest to you. Thanks again @LeonardRockstar

allenwixted avatar Apr 21 '18 17:04 allenwixted

Thank you @allenwixted . I was able to get it to work...kind of. I was able to save and import it into the AppCoda demo file, but I still can't get the AppCoda project to work. I'm now getting error messages saying that 'RecordAR' is unavailable: cannot find Swift declaration for this class and 'RecordAR' has been explicitly marked unavailable here (ARVideoKit.RecordAR). Any ideas?

jslusser avatar May 09 '18 16:05 jslusser

I too am having this issue mentioned by @jslusser. Please advise.

youllbejustfine avatar May 18 '18 21:05 youllbejustfine

I had a similar issue to @jslusser, just make sure you're running on a real device!

anushkmittal avatar May 18 '18 21:05 anushkmittal

Thanks for the quick response @anushkmittal - it works when I run on the device. But I'm currently trying to Archive to submit to the App Store, and during the compile it fails. Any idea why?

youllbejustfine avatar May 18 '18 21:05 youllbejustfine

do select generic iOS device!

anushkmittal avatar May 18 '18 21:05 anushkmittal

@anushkmittal - yes, Generic iOS Device is indeed selected! Anything else I can try?

youllbejustfine avatar May 18 '18 21:05 youllbejustfine

To follow up, much like @allenwixted, I had to set the Deployment Target to iOS 11

youllbejustfine avatar May 18 '18 21:05 youllbejustfine