Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Camera preview not showing on first launch #189

Open
asos-savvasdalkitsis opened this issue Mar 27, 2017 · 5 comments
Open

Camera preview not showing on first launch #189

asos-savvasdalkitsis opened this issue Mar 27, 2017 · 5 comments

Comments

@asos-savvasdalkitsis
Copy link

asos-savvasdalkitsis commented Mar 27, 2017

General information

  • SDK/Library version: 5.5.1
  • Android Version and Device: Android 7.7.1 Nexus 6P

Issue description

Updating to the newest version of the library (5.5.1) introduces a bug on the first launch of the activity.

On a clean installation, launching the screen asks for the camera permission. When allowed, the cardio activity is shown but no camera preview is displayed (the keyboard button is the only thing visible).

Backing out and launching the screen again works just fine.

Logs:

03-27 16:58:16.881 939-4150/? I/ActivityManager: START u0 {cmp=com.asos.app.dev.debug/io.card.payment.CardIOActivity (has extras)} from uid 10357 on display 0
                                                 
03-27 16:58:16.897 536-683/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
03-27 16:58:16.900 536-683/? D/audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback speaker
03-27 16:58:16.926 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [ar,CARDTYPE_MAESTRO]
03-27 16:58:16.927 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [da,CARDTYPE_MAESTRO]
03-27 16:58:16.927 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [de,CARDTYPE_MAESTRO]
03-27 16:58:16.928 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [en_AU,CARDTYPE_MAESTRO]
03-27 16:58:16.929 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [en_GB,CARDTYPE_MAESTRO]
03-27 16:58:16.929 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [es,CARDTYPE_MAESTRO]
03-27 16:58:16.930 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [es_MX,CARDTYPE_MAESTRO]
03-27 16:58:16.930 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [fr,CARDTYPE_MAESTRO]
03-27 16:58:16.931 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [he,CARDTYPE_MAESTRO]
03-27 16:58:16.931 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [is,CARDTYPE_MAESTRO]
03-27 16:58:16.931 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [it,CARDTYPE_MAESTRO]
03-27 16:58:16.932 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [ja,CARDTYPE_MAESTRO]
03-27 16:58:16.932 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [ko,CARDTYPE_MAESTRO]
03-27 16:58:16.933 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [ms,CARDTYPE_MAESTRO]
03-27 16:58:16.933 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [nb,CARDTYPE_MAESTRO]
03-27 16:58:16.933 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [nl,CARDTYPE_MAESTRO]
03-27 16:58:16.934 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [pl,CARDTYPE_MAESTRO]
03-27 16:58:16.934 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [pt,CARDTYPE_MAESTRO]
03-27 16:58:16.935 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [pt_BR,CARDTYPE_MAESTRO]
03-27 16:58:16.935 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [ru,CARDTYPE_MAESTRO]
03-27 16:58:16.935 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [sv,CARDTYPE_MAESTRO]
03-27 16:58:16.936 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [th,CARDTYPE_MAESTRO]
03-27 16:58:16.936 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [tr,CARDTYPE_MAESTRO]
03-27 16:58:16.937 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [zh-Hans,CARDTYPE_MAESTRO]
03-27 16:58:16.937 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [zh-Hant,CARDTYPE_MAESTRO]
03-27 16:58:16.937 15005-15005/com.asos.app.dev.debug I/I18nManager: Missing [zh-Hant_TW,CARDTYPE_MAESTRO]
03-27 16:58:16.937 15005-15005/com.asos.app.dev.debug D/I18nManager: null not found.  Attempting to look for en_GB
03-27 16:58:16.938 15005-15005/com.asos.app.dev.debug D/I18nManager: setting locale to:en_GB
03-27 16:58:16.938 15005-15005/com.asos.app.dev.debug D/I18nManager: null not found.  Attempting to look for en_GB
03-27 16:58:16.938 15005-15005/com.asos.app.dev.debug D/I18nManager: setting locale to:en_GB
03-27 16:58:16.939 15005-15005/com.asos.app.dev.debug I/card.io: card.io 5.5.1 03/17/2017 14:23:12 -0400
03-27 16:58:16.940 15005-15005/com.asos.app.dev.debug D/card.io: Loaded card.io decider library.
03-27 16:58:16.941 15005-15005/com.asos.app.dev.debug D/card.io:     nUseNeon(): false
03-27 16:58:16.941 15005-15005/com.asos.app.dev.debug D/card.io:     nUseTegra():true
03-27 16:58:16.942 15005-15005/com.asos.app.dev.debug D/card.io:     nUseX86():  false
03-27 16:58:16.945 15005-15005/com.asos.app.dev.debug D/card.io: Loaded opencv core library
03-27 16:58:16.949 15005-15005/com.asos.app.dev.debug D/card.io: Loaded opencv imgproc library
03-27 16:58:16.952 15005-15005/com.asos.app.dev.debug I/card.io: Loaded card.io Tegra2 library
03-27 16:58:16.953 15005-15005/com.asos.app.dev.debug D/CardIOActivity: permission denied to camera - requesting it
03-27 16:58:16.954 939-4146/? I/ActivityManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.packageinstaller cmp=com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity (has extras)} from uid 10357 on display 0
03-27 16:58:16.981 526-615/? I/ThermalEngine: ACTION: GPU - Setting GPU[0] to 510000000
03-27 16:58:17.111 939-1023/? I/ActivityManager: Displayed com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity: +113ms (total +208ms)
03-27 16:58:17.115 15005-15005/com.asos.app.dev.debug W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection
03-27 16:58:17.115 15005-15005/com.asos.app.dev.debug W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
03-27 16:58:17.423 536-683/? D/audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback speaker
03-27 16:58:17.430 536-683/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
03-27 16:58:18.020 939-939/? I/GnssLocationProvider: WakeLock acquired by sendMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@2a60c91)
03-27 16:58:18.024 939-952/? I/GnssLocationProvider: WakeLock released by handleMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@2a60c91)
03-27 16:58:18.033 536-683/? D/audio_hw_primary: enable_snd_device: snd_device(2: speaker)
03-27 16:58:18.036 536-683/? D/audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback speaker
03-27 16:58:18.054 537-9580/? I/CameraService: CameraService::connect call (PID -1 "com.asos.app.dev.debug", camera ID 0) for HAL version default and Camera API version 1
03-27 16:58:18.067 545-15703/? D/NuPlayerDriver: notifyListener_l(0xe6b2b0e0), (1, 0, 0), loop setting(0, 0)
03-27 16:58:18.077 545-15705/? D/NuPlayerDriver: notifyListener_l(0xe6b2b440), (1, 0, 0), loop setting(0, 0)
03-27 16:58:18.088 545-15707/? D/NuPlayerDriver: notifyListener_l(0xe6b2b4a0), (1, 0, 0), loop setting(0, 0)
03-27 16:58:18.088 537-9580/? I/Camera2ClientBase: Camera 0: Opened. Client: com.asos.app.dev.debug (PID 15005, UID 10357)
03-27 16:58:18.090 537-9580/? I/CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=0
03-27 16:58:18.096 537-9580/? I/CameraService: onTorchStatusChangedLocked: Torch status changed for cameraId=0, newStatus=0
03-27 16:58:18.103 550-15717/? E/mm-camera-img: module_imglib_start_session:1778 ###Img_Loglevel 1
03-27 16:58:18.103 550-15712/? E/mm-camera-isp2: isp_module_start_session:360 num_session_opened 1
03-27 16:58:18.112 550-15713/? E/mm-camera: q3a_port_init:1753  q3a_port_init: 3A VERSION --> 4.1.0.r9
03-27 16:58:18.118 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3990904832 fd=40 heapid=33554432
03-27 16:58:18.120 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3986935808 fd=42 heapid=33554432
03-27 16:58:18.123 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3978997760 fd=43 heapid=33554432
03-27 16:58:18.128 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3974815744 fd=44 heapid=33554432
03-27 16:58:18.132 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3966451712 fd=45 heapid=33554432
03-27 16:58:18.137 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3946328064 fd=46 heapid=33554432
03-27 16:58:18.140 550-15725/? E/libaprpmem:  Ion allocation success virtaddr : ret=3935842304 fd=47 heapid=33554432
03-27 16:58:18.154 550-15710/? E/mm-camera-sensor: sensor_sdk_util_get_kernel_i2c_addr_type:26Invalid addr_type = 0
03-27 16:58:18.154 550-15710/? E/mm-camera-sensor: sensor_sdk_util_get_kernel_i2c_data_type:40Invalid addr_type = 0
03-27 16:58:18.157 550-15710/? E/mm-camera-sensor: sensor_sdk_util_get_kernel_i2c_data_type:40Invalid addr_type = 0
03-27 16:58:18.157 550-15710/? E/mm-camera-sensor: sensor_sdk_util_get_kernel_i2c_addr_type:26Invalid addr_type = 0
03-27 16:58:18.171 550-15727/? E/mm-camera: mct: mct_pipeline_start_stream_internal: Adding session stream streamid= 0xf for session=3
03-27 16:58:18.171 550-15727/? E/mm-camera: mct: mct_pipeline_start_stream_internal:Linking session stream for session 3
03-27 16:58:18.172 550-15727/? E/mm-camera-sensor: port_sensor_caps_reserve:87session id doesn't match
03-27 16:58:18.173 550-15727/? E/mm-camera: mct: mct_pipeline_start_stream_internal:Session stream linked successfully session 3
03-27 16:58:18.176 537-9580/? W/Camera2-Parameters: initialize: Camera 0: Unknown preview format: 24
03-27 16:58:18.176 537-9580/? W/Camera2-Parameters: initialize: Camera 0: Unknown preview format: 25
03-27 16:58:18.177 537-9580/? I/Camera2-Parameters: initialize: allowZslMode: 1 slowJpegMode 0
03-27 16:58:18.193 15005-15005/com.asos.app.dev.debug W/Bundle: Key io.card.payment.scanInstructions expected String but value was a java.lang.Boolean.  The default value <null> was returned.
03-27 16:58:18.194 15005-15005/com.asos.app.dev.debug W/Bundle: Attempt to cast generated internal exception:
                                                                java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
                                                                    at android.os.BaseBundle.getString(BaseBundle.java:995)
                                                                    at android.content.Intent.getStringExtra(Intent.java:6243)
                                                                    at io.card.payment.CardIOActivity.setPreviewLayout(CardIOActivity.java:968)
                                                                    at io.card.payment.CardIOActivity.showCameraScannerOverlay(CardIOActivity.java:488)
                                                                    at io.card.payment.CardIOActivity.onRequestPermissionsResult(CardIOActivity.java:638)
                                                                    at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7084)
                                                                    at android.app.Activity.dispatchActivityResult(Activity.java:6936)
                                                                    at android.app.ActivityThread.deliverResults(ActivityThread.java:4085)
                                                                    at android.app.ActivityThread.handleSendResult(ActivityThread.java:4132)
                                                                    at android.app.ActivityThread.-wrap20(ActivityThread.java)
                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1533)
                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                    at android.os.Looper.loop(Looper.java:154)
                                                                    at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
03-27 16:58:18.226 15005-15005/com.asos.app.dev.debug D/MEMORY: Native memory stats: (free/alloc'd/total)6760952/39376392/46137344
03-27 16:58:18.239 939-5724/? I/sensors: batch
03-27 16:58:18.240 939-5724/? I/nanohub: queueBatch: sensor=1, handle=1, period=66667000, latency=0
03-27 16:58:18.241 939-5724/? I/sensors: activate
03-27 16:58:18.242 939-5724/? I/nanohub: queueActivate: sensor=1, handle=1, enable=1
03-27 16:58:18.316 409-409/? W/SurfaceFlinger: couldn't log to binary event log: overflow.
03-27 16:58:18.568 536-683/? D/audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback speaker
03-27 16:58:18.574 536-683/? D/audio_hw_primary: disable_snd_device: snd_device(2: speaker)
03-27 16:58:18.593 4193-15753/? I/SubscribedFeeds: Received message
03-27 16:58:18.626 12265-15754/? I/Gmail: Sync started for account: account:-1001528347
03-27 16:58:18.629 12265-15754/? I/UnifiedEmail: notifyAccountChanged
03-27 16:58:18.639 12265-15755/? I/UnifiedEmail: getAccountsCursor
03-27 16:58:18.792 12265-15754/? I/Gmail: MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 319909, normalSync: true
03-27 16:58:18.906 12265-15754/? D/ApplicationLoaders: ignored Vulkan layer search path /data/app/com.google.android.gms-1/lib/arm64:/system/fake-libs64:/data/app/com.google.android.gms-1/base.apk!/lib/arm64-v8a for namespace 0x76817820f0
03-27 16:58:18.934 12265-15754/? V/JNIHelp: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 242 native methods...
03-27 16:58:18.963 12265-15754/? D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
03-27 16:58:18.971 12265-15754/? I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
@chawino
Copy link

chawino commented Apr 19, 2017

I found too

SDK/Library version: 5.5.1
Android Version and Device: Android 7.0 Samsung Galaxy S7 Edge

@avocadomayo
Copy link

I'm having the same issue as well.
SDK/Library ver.: 5.5.1
Android ver. and device: Android 7.0 Moto G5

Launching activity displays request for permission, but after that a black screen.
When I navigate away & come back, preview is available.

@RohanTT
Copy link

RohanTT commented Jul 19, 2017

SDK/Library ver.: 5.5.1

First launch camera issue still persist, any update on same... ? :(

Posting sample app logs for more details

07-19 13:24:19.058 25323-25323/io.card.development D/I18nManager: null not found. Attempting to look for en_US
07-19 13:24:19.058 25323-25323/io.card.development D/I18nManager: setting locale to:en
07-19 13:24:19.058 25323-25323/io.card.development D/I18nManager: setting locale to:en
07-19 13:24:19.059 25323-25323/io.card.development I/card.io: card.io 5.5.1 03/17/2017 14:23:12 -0400
07-19 13:24:19.062 25323-25323/io.card.development D/card.io: Loaded card.io decider library.
07-19 13:24:19.064 25323-25323/io.card.development D/card.io: nUseNeon(): false
07-19 13:24:19.064 25323-25323/io.card.development D/card.io: nUseTegra():true
07-19 13:24:19.064 25323-25323/io.card.development D/card.io: nUseX86(): false
07-19 13:24:19.065 25323-25323/io.card.development D/card.io: Loaded opencv core library
07-19 13:24:19.067 25323-25323/io.card.development D/card.io: Loaded opencv imgproc library
07-19 13:24:19.069 25323-25323/io.card.development I/card.io: Loaded card.io Tegra2 library
07-19 13:24:19.070 25323-25323/io.card.development D/CardIOActivity: permission denied to camera - requesting it
07-19 13:24:19.209 25323-25343/io.card.development D/OpenGLRenderer: endAllActiveAnimators on 0x794f89dc00 (RippleDrawable) with handle 0x793d17ee40
07-19 13:24:24.551 25323-25323/io.card.development D/MEMORY: Native memory stats: (free/alloc'd/total)2354080/12325984/14680064
07-19 13:24:31.043 25323-25323/io.card.development W/CardScanner: could not trigger auto focus: java.lang.RuntimeException: autoFocus failed

I guess, The last line causing issue from CardScanner

@dkim1000
Copy link

dkim1000 commented Oct 6, 2017

Same issue

Pixel XL: Android 8.0.0
SDK/Library ver.: 5.5.1

Issue is fixed on 5.5.0 but re-introduces #150

@calvarez-ov
Copy link

Any news on this? We'll have to stay on 5.5.0 until this is fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants