0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ARWorldTrackingConfigurationで画像認識を使うと固まる問題

Last updated at Posted at 2018-10-09

問題

ARWorldTrackingConfiguration以下のように定義して、viewWillAppearで呼んでいたのですが、

private let configuration: ARWorldTrackingConfiguration = {
    let configuration = ARWorldTrackingConfiguration()
    guard let referenceImages = ARReferenceImage
        .referenceImages(inGroupNamed: "AR Resources", bundle: nil) else {
            fatalError("Missing expected asset catalog resources.")
    }
    configuration.detectionImages = referenceImages
    return configuration
}()

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    
    sceneView.session.run(configulation)
}

Xcode10でDeploymentTargetをiOS11.3やiOS11にして、iOS12でビルドすると、カメラがすぐに固まってしまいます。

再現方法

  • Xcode 10.0
  • DeploymentTarget iOS11.3
  • iOS12でビルド(ちなみにiOS11.4の端末でやると再現しない)

解決策

ちなみにDeploymentTargetをiOS12にすると治ります。

いやいやiOS12以下を切るのとかまだ現実的じゃない。。w

解決策2(追記)

「Xcode 10.1」でビルドしたら治るかも

解決策3(追記)

僕はこれで治りました。

ARImageResourcesに登録している画像がpngだったらjpgに変換してみてください。
https://forums.developer.apple.com/thread/104361

# 関連

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?