I'm trying to use playground in xcode 7 to test some code but for some reason it won't run.
This is the error I'm getting
Playground execution failed: /var/folders/q6/zswv_4wj16zbckfbdtl9lmyh0000gp/T/./lldb/11352/playground14.swift:1:8: error: module file's minimum deployment target is ios9.0 v9.0: /var/folders/q6/zswv_4wj16zbckfbdtl9lmyh0000gp/T/com.apple.dt.Xcode.pg/auxiliarymodules/C2294E15-2E60-47B3-8A0B-DABB2C0C3D88/MyPlayground_Sources.framework/Modules/MyPlayground_Sources.swiftmodule/x86_64.swiftmodule
import MyPlayground_Sources
This is the very simple code I'm trying to execute.
class testClass{
var property = "some property"
}
var test = testClass()
test.property
What does it mean by module file's minimum deployment target is ios9.0?
I think I found what the problem is.
I opened an Xcode 6 playground file in Xcode 7.
When I create a new playground in Xcode 7 it works fine.
Related
There is a func checkSum.I am invoking checkScope() before initializing sumation variable.If I invoke checkScope() again the code runs perfectly .
func checkScope (){
sumation = 6
print(sumation)
}
checkScope()
var sumation = 5
checkScope()
The Playground is so polite and executes the code although it's wrong. The reason is that unlike a Xcode project you can run code on the top level in a Playground.
In a project you will get a Unresolved Identifier compiler error.
The rule is: A variable must be declared and initialized (in the same scope) before being used.
Nevertheless the compiler error is shown in the Playground, too
I have created an ARKit project using a beta version of Xcode 9, which I was able to run on my real device without issues.
Yesterday, I upgraded to Xcode 9 GM, and without touching anything, Xcode shows multiple errors, saying it does not know ARSessionConfiguration i.e.:
Use of undeclared type 'ARSessionConfiguration'
and:
Use of undeclared type 'ARWorldTrackingSessionConfiguration'
...for this code:
let session = ARSession()
var sessionConfig: ARSessionConfiguration = ARWorldTrackingSessionConfiguration()
I have imported ARKit and am using the ARSCNViewDelegate in my ViewController.
When opening the project from the beta version of Xcode, it does not show the errors and I can again run the app on my phone.
Any idea how I can fix this?
ARWorldTrackingSessionConfiguration has been deprecated and renamed to ARWorldTrackingConfiguration: See here
Also, ARSessionConfiguration has been deprecated and renamed to ARConfiguration, which is now an abstract base class.
Use AROrientationTrackingConfiguration when you don't want world tracking, instead of using a generic ARConfiguration. Thus:
let configuration = AROrientationTrackingConfiguration()
You can also check if world tracking is supported on a device:
if ARWorldTrackingConfiguration.isSupported {
configuration = ARWorldTrackingConfiguration()
}
else {
configuration = AROrientationTrackingConfiguration()
}
In Xcode 9 GM, looks like ARWorldTrackingSessionConfiguration has been renamed to ARWorldTrackingConfiguration:
https://developer.apple.com/documentation/arkit/arworldtrackingconfiguration
Reference to this change:
https://github.com/markdaws/arkit-by-example/issues/7
ARSessionConfiguration has been renamed to ARConfiguration:
https://developer.apple.com/documentation/arkit/arconfiguration
hi it's my first time to post.
I'm now doing a tutorial on Xcode 8.2.1 playground using SQLite from below website:
https://www.raywenderlich.com/123579/sqlite-tutorial-swift
I downloaded a Xcode source containing a playground and a SQLite project, and i uploaded it to the following path.
https://github.com/TerryDon2017/My-SQLite.swift-master-tutorial.git
I have the error message below:
Playground execution failed: error: SQLite.playground:1:8: error: no
such module 'SQLite' import SQLite
^ thread #1: tid = 0x1cd7d, 0x00000001094e9360 com.apple.dt.Xcode.PlaygroundStub-macosx`executePlayground, queue =
'com.apple.main-thread', stop reason = breakpoint 1.1
I was told to do 2 things:
1.drag the SQLite.xcodeproj to the workspace
2.set the build dependency
i think I did 1 ok but for 2 i could not find anyway to set the dependency for the playground. could you please kindly help? thanks!
I am attempting to use Fastlane to take screenshots of my app using the snapshot tool. However The conversion to Objective-C doesn't appear to be working correctly. I have Project-Swift.h imported into my ProjectUITests.m file, and I have included the following code:
SnapshotHelper *snapshotHelper = [[SnapshotHelper alloc] init];
[snapshotHelper setLanguage:app];
[snapshotHelper snapshot:#"01Homescreen" waitForLoadingIndicator:YES];
However, when I run the command "snapshot" in the command line, I get the following errors:
Testing failed:
Use of undeclared identifier 'SnapshotHelper'
Use of undeclared identifier 'snapshotHelper'
(1 failure)
[12:14:52]: Exit status: 65
[12:14:52]: Tests failed - check out the log above
So my question is, how do I get the SnapshotHelper.swift file to run successfully in my ProjectUITests.m file?
I had to change the SnapshotHelper.swift file:
var deviceLanguage = ""
#objc class SnapshotHelper : NSObject { // <--- add this
#available(*, deprecated, message="use setupSnapshot: instead")
class func setLanguage(app: XCUIApplication) {
setupSnapshot(app)
}
...
} // ...#objc class
(Here is the related issue on github: https://github.com/fastlane/snapshot/issues/228)
From time to time my Xcode did not create the bridging headers for me. The easiest work around for that was to remove the swift file from the project and add it again. Usually then Xcode asked whether I want the bridging headers.
Eventually you may need to go to your target's Build Settings > Apple LLVM 7.0 - Language - Modules > Enabled Modules (C and Objective-C) = YES .
I am using the "Debug Selected Views" feature in Xcode 6 beta 5, I set a breakpoint within my prepareForInterfaceBuilder() function.
But when I try to use the po command, it gives me an error:
(lldb) po almondImage
error: Error in auto-import:
Failed to load linked library swiftQuartzCore of module TrailMixKit - errors:
Looking for "#rpath/libswiftQuartzCore.dylib", error: not a string object
Here are the first few lines of my file (including imports):
//
// TrailMixIngredientImageView.swift
// Trailmix
import UIKit
import QuartzCore
If I set a breakpoint while running the app in the simulator, the po command works without error.
Can't add comment but did you add the framework for QuartzCore?