Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Camera does not work ("Camera has stopped") #21

Closed
jamuir opened this issue Apr 12, 2018 · 11 comments
Closed

Google Camera does not work ("Camera has stopped") #21

jamuir opened this issue Apr 12, 2018 · 11 comments
Labels
bug camera validation pending A potential fix has been commited, this needs to be validated with next release

Comments

@jamuir
Copy link
Contributor

jamuir commented Apr 12, 2018

The Google Camera (from opengapps) closes shortly after it is opened on some phh-GSI devices (the Sony XZ1 Compact, in particular). Other Camera apks work correctly (e.g. Open Camera by M Harman).

This may be an opengapps issue, but opening here so that it can be identified as a known issue.

Relevant Logcat output:

04-09 01:43:20.827 D/AndroidRuntime( 4294): Shutting down VM
--------- beginning of crash
04-09 01:43:20.828 E/AndroidRuntime( 4294): FATAL EXCEPTION: main
04-09 01:43:20.828 E/AndroidRuntime( 4294): Process: com.google.android.GoogleCamera, PID: 4294
04-09 01:43:20.828 E/AndroidRuntime( 4294): java.lang.RuntimeException: java.lang.IllegalArgumentException: Could not find tag for key 'com.google.nexus.experimental2016.3a.hybrid_ae_enable')
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at dlx.run(PG:2)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.os.Handler.handleCallback(Handler.java:789)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.os.Handler.dispatchMessage(Handler.java:98)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.os.Looper.loop(Looper.java:164)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.app.ActivityThread.main(ActivityThread.java:6541)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at java.lang.reflect.Method.invoke(Native Method)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
04-09 01:43:20.828 E/AndroidRuntime( 4294): Caused by: java.lang.IllegalArgumentException: Could not find tag for key 'com.google.nexus.experimental2016.3a.hybrid_ae_enable')
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.hardware.camera2.impl.CameraMetadataNative.nativeGetTagFromKeyLocal(Native Method)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.hardware.camera2.impl.CameraMetadataNative.setBase(CameraMetadataNative.java:978)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:429)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:433)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at android.hardware.camera2.CaptureRequest$Builder.set(CaptureRequest.java:590)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at iia.a(PG:4)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at gfx.a(PG:56)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at doo.a(PG:8)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at efs.a(PG:7)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at dlw.run(PG:7)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at jvp.b(PG:5)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at juu.run(PG:8)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at jvn.run(PG:11)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at java.lang.Thread.run(Thread.java:764)
04-09 01:43:20.828 E/AndroidRuntime( 4294): 	at avv.run(PG:8)
@jamuir
Copy link
Contributor Author

jamuir commented Apr 12, 2018

it seems like Google Camera is looking for certain values in com.google.nexus.experimental2016.jar, but they are missing.

@jamuir
Copy link
Contributor Author

jamuir commented Apr 12, 2018

the jar itself may be fine. it is actually the native method nativeGetTagFromKeyLocal() that fails.

the key/string com.google.nexus.experimental2016.3a.hybrid_ae_enable comes from the jar:

$ adb pull /system/framework/com.google.android.camera.experimental2016.jar
/system/framework/com.google.android.camera.experimental2016.jar: 1 file pulled. 0.6 MB/s (2161 bytes in 0.003s)
$ unzip -p com.google.android.camera.experimental2016.jar | strings | grep hybrid
5com.google.nexus.experimental2016.3a.hybrid_ae_enable

Note that Google Camera still crashes in permissive-mode.

@jamuir
Copy link
Contributor Author

jamuir commented Apr 12, 2018

I deleted two files from the system image and Google Camera started to work (and the sony green-screen issue also went away!). This was suggested in the following XDA post:

https://forum.xda-developers.com/showpost.php?p=69843893&postcount=184

$ adb root
$ adb shell mount -o rw,remount /system
$ adb shell stop
$ adb shell rm /system/etc/permissions/com.google.android.camera.experimental2016.xml 
$ adb shell rm /system/framework/com.google.android.camera.experimental2016.jar
$ adb reboot

@newyesor
Copy link

You use google camera version?

@jamuir
Copy link
Contributor Author

jamuir commented May 16, 2018

Yes, I am using Google Camera from OpenGApps in my GSI.

@newyesor
Copy link

You can share file Google Camera from OpenGapps.

@jamuir
Copy link
Contributor Author

jamuir commented May 17, 2018

@phhusson
Copy link
Owner

Should be fixed by phhusson/device_phh_treble@639dd35

@phhusson phhusson added the validation pending A potential fix has been commited, this needs to be validated with next release label May 26, 2018
@phhusson phhusson closed this as completed Oct 2, 2018
@4PERTURE
Copy link

4PERTURE commented Jan 5, 2019

I deleted two files from the system image and Google Camera started to work (and the sony green-screen issue also went away!). This was suggested in the following XDA post:

https://forum.xda-developers.com/showpost.php?p=69843893&postcount=184

$ adb root
$ adb shell mount -o rw,remount /system
$ adb shell stop
$ adb shell rm /system/etc/permissions/com.google.android.camera.experimental2016.xml 
$ adb shell rm /system/framework/com.google.android.camera.experimental2016.jar
$ adb reboot

Thanks for this. I was having this problem in a ROM and this did the trick.

@saravanabalagi
Copy link

@4PERTURE Hi, I am trying to do adb shell stop from terminal emulator as stop and that command blacks the phone out. I don't know what stop does, but I can't seem to delete /system/etc/permissions/com.google.android.camera.experimental2016.xml or /system/framework/com.google.android.camera.experimental2016.jar as it says device or resource busy. Any ideas?

@saravanabalagi
Copy link

Workaround: I rebooted the phone in recovery mode and deleted those two files. Gcam's working now

PS: But I would still want to know what stop does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug camera validation pending A potential fix has been commited, this needs to be validated with next release
Projects
None yet
Development

No branches or pull requests

5 participants