How to add image on ar resource of asset file
After saving the image in assets, you need to give the name, width, height and units of the image. You can refer this
Xcode Error: AR reference image must have non zero positive width
ARKit image detection, add image
Assuming that referenceImage.name
's value is the actual image filename.
if let imageName = referenceImage.name {
plane.materials = [SCNMaterial()]
plane.materials[0].diffuse.contents = UIImage(named: imageName)
}
The AR Session Failed. One or more reference images have an invalid size
Solution 1
This post
stated:
the error message is a bit missleading. Try setting your Deployment Target (in Unity or later in Xcode) to 12.0. This fixes the issue for me.
Which has fixed our issue.
Solution 2
Additionally, leaving our Deployment Target as is (10.0
) and ensuring that the reference image is a .jpg
has also solved this for us.
Related Topics
"Ambiguous Reference to Member Map" When Attempting to Append/Replace Array Element
Fbsdksharephoto Not Sharing Link Alongside Photo Using Swift
Sknode Subclass Generates Error: Cannot Invoke Initializer for Type "X" with No Arguments
How to Cast from Cftyperef to Axuielement in Swift
Picker Not Working When Editmode Is Active
Swift: Parse, Query Date Field Based on Nsdate()
Arkit - Getting "Unexpectedly Found Nil" When Using Scn File > 300 Mb
How to Change Font Size of Nstableheadercell
Can't Get Throws to Work with Function with Completion Handler
iOS 16 Swiftui List Background
How to Create Generic Convenience Initializer in Swift
Implement Protocol with Different Associated Type
Uidatepicker Show Only Sunday's Date Only
Convert from Nsdictionary to [String:Any]
How to Add Two Generic Values in Swift
Accessing an Actor's Isolated State from Within a Swiftui View