Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Camera2Basic failed to open camera normally

Đang mở
#545 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
android, kotlin
Lĩnh vực
mobile

Hướng nghiên cứu

Tái hiện lỗi khởi động Camera2Basic trong Android Studio trên một thiết bị chỉ có camera trước, bắt đầu từ CameraActivity và đường dẫn mở camera được chỉ ra trong log. So sánh lần khởi chạy thành công đầu tiên với các lần khởi chạy sau đó, đồng thời sử dụng startup log được báo cáo để xác định việc mở camera dừng ở đâu. Được xem là hoàn thành khi sample mở camera trước một cách ổn định sau khi thoát, xóa dữ liệu hoặc cài đặt lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

After I import Camera2Basic into Android Studio and run it (My device only has front camera)

for the first time, camera opened normally, then no matter I exit camera, clear the cache/data, uninstall the APP and reinstall it, camera still failed to open again. log from Android Studio is as below:

It seems stunk in the starting window, in the left-top window, it shows 'Front JPEG (0)'

2023-05-24 15:22:45.556  9183-9183  studio.deploy           pid-9183                             E  Could not remove dir '/data/data/com.android.example.camera2.basic/code_cache/.ll/': No such file or directory
---------------------------- PROCESS STARTED (9201) for package com.android.example.camera2.basic ----------------------------
2023-05-24 15:22:47.208  9201-9201  chatty                  com.android.example.camera2.basic    I  uid=10054(com.android.example.camera2.basic) re-initialized> identical 1 line
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/content/res/ResourcesKey;-><init>(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;ILandroid/content/res/Configuration;Landroid/content/res/CompatibilityInfo;[Landroid/content/res/loader/ResourcesLoader;)V (blacklist, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/app/ResourcesManager;->invalidatePath(Ljava/lang/String;)V (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/content/res/ResourcesKey;->isPathReferenced(Ljava/lang/String;)Z (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager;->mCachedApkAssets:Landroid/util/ArrayMap; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager;->mCachedApkAssets:Landroid/util/ArrayMap; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager$ApkKey;->path:Ljava/lang/String; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager;->mCachedApkAssets:Landroid/util/ArrayMap; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/content/res/ApkAssets;->close()V (blacklist, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager;->mCachedApkAssets:Landroid/util/ArrayMap; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager$ApkKey;->path:Ljava/lang/String; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager;->mCachedApkAssets:Landroid/util/ArrayMap; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.209  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/content/res/ApkAssets;->close()V (blacklist, linking, denied)
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/app/ResourcesManager;->isSameResourcesOverrideConfig(Landroid/os/IBinder;Landroid/content/res/Configuration;)Z (greylist-max-o, linking, denied)
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager$ActivityResources;->overrideConfig:Landroid/content/res/Configuration; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.210  9201-9201  chatty                  com.android.example.camera2.basic    I  uid=10054(com.android.example.camera2.basic) identical 1 line
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager$ActivityResources;->overrideConfig:Landroid/content/res/Configuration; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/content/res/Configuration;->diffPublicOnly(Landroid/content/res/Configuration;)I (greylist-max-o, linking, denied)
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/app/ResourcesManager;->overrideTokenDisplayAdjustments(Landroid/os/IBinder;Ljava/util/function/Consumer;)Z (blacklist, linking, denied)
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden field Landroid/app/ResourcesManager$ActivityResources;->activityResources:Ljava/util/ArrayList; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.210  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/content/res/Resources;->overrideDisplayAdjustments(Ljava/util/function/Consumer;)V (blacklist, linking, denied)
2023-05-24 15:22:47.211  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/app/ResourcesManager;->updateResourcesForActivity(Landroid/os/IBinder;Landroid/content/res/Configuration;IZ)V (greylist-max-o, linking, denied)
2023-05-24 15:22:47.211  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/app/ResourcesManager;->getOrCreateActivityResourcesStructLocked(Landroid/os/IBinder;)Landroid/app/ResourcesManager$ActivityResources; (greylist-max-o, linking, denied)
2023-05-24 15:22:47.218  9201-9201  studio.deploy           com.android.example.camera2.basic    I  JVMTI::HiddenAPIWarning:Restoring not supported
2023-05-24 15:22:47.482  9201-9201  NetworkSecurityConfig   com.android.example.camera2.basic    D  No Network Security Config specified, using platform default
2023-05-24 15:22:47.483  9201-9201  NetworkSecurityConfig   com.android.example.camera2.basic    D  No Network Security Config specified, using platform default
2023-05-24 15:22:47.662  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2023-05-24 15:22:47.664  9201-9201  e.camera2.basi          com.android.example.camera2.basic    W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2023-05-24 15:22:47.752  9201-9201  CameraManagerGlobal     com.android.example.camera2.basic    I  Connecting to camera service
2023-05-24 15:22:47.793  9201-9217  System                  com.android.example.camera2.basic    W  A resource failed to call close. 
2023-05-24 15:22:47.793  9201-9217  System                  com.android.example.camera2.basic    W  A resource failed to call close. 
2023-05-24 15:22:47.972   475-1511  BufferQueueProducer     surfaceflinger                       E  [com.android.example.camera2.basic/com.example.android.camera2.basic.CameraActivity#0](id:1db0000006e,api:0,p:-1,c:475) disconnect: not connected (req=1)
2023-05-24 15:22:47.972  9201-9226  libEGL                  com.android.example.camera2.basic    W  EGLNativeWindowType 0xeba00018 disconnect failed
Ngôn ngữ chính
Kotlin
Star
5.5k
Fork
2.4k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của android/camera-samples

Tất cả issue của android/camera-samples

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.