Xcode Objective c - camera black screen

+1 vote
asked Jan 6, 2022 by wayikdev (200 points)

Hello all,

I have made my own Objective C app, using the original iOS sample code from "HelloARVideo". 

1. When running the "HelloARVideo" app, with my own JPG and MP4, it works perfect. There is no problem with latest Xcode version and iOS version. Debugger output is:

2022-01-06 14:57:17.056983-0600 helloarvideo[919:447608] EasyAR Sense (iOS-arm64) Version 4.4.0.9304-eb4ecde40

2022-01-06 14:57:17.319162-0600 helloarvideo[919:447608] Metal API Validation Enabled

2022-01-06 14:57:18.090919-0600 helloarvideo[919:447608] load target (1): namecard (1)

2022-01-06 14:57:18.091340-0600 helloarvideo[919:447608] load target (1): argame (2)

2022-01-06 14:57:18.091589-0600 helloarvideo[919:447608] load target (1): idback (3)

2022-01-06 14:57:19.113694-0600 helloarvideo[919:447931] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed

2022-01-06 14:57:19.113768-0600 helloarvideo[919:447931] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed

2022-01-06 14:57:19.239565-0600 helloarvideo[919:447937] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed

2022-01-06 14:57:19.239760-0600 helloarvideo[919:447937] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed

2. When using the same code from "HelloARVideo in my own app, instead of having the camera activated, I am getting a black screen. Debugger output is:

2022-01-06 13:36:39.020586-0600 LaRedonda[902:427455] EasyAR Sense (iOS-arm64) Version 4.4.0.9304-eb4ecde40

2022-01-06 13:36:39.268859-0600 LaRedonda[902:427455] Metal API Validation Enabled

2022-01-06 13:36:40.639132-0600 LaRedonda[902:427653] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed

2022-01-06 13:36:40.639246-0600 LaRedonda[902:427653] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed

2022-01-06 13:36:40.645555-0600 LaRedonda[902:427653] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for read_timeout failed

2022-01-06 13:36:40.645659-0600 LaRedonda[902:427653] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2.1 47.116.17.199:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] unregister notification for write_timeout failed

The only difference that I can see is, that in my own app, the debugger don't show that that loadTarget was done.

Both are compiled as iOS 13.6. Both has the same Frameworks.

Any idea? 

Greetings and many thanks for help

Dietmar

1 Answer

0 votes
answered Jan 7, 2022 by wayikdev (200 points)

Shame on me, a rookie error and that after years of developing.

The solution was to change 

@interface ARView : UIViewController

to

@interface ARView : GLKViewController

after this change, the app works fine!!!

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...