2

I have been working for a year with Android Studio(I am newbie hehe) and I have never faced this problem.

When I take a photo and press the ok button the camera crashes and logs do not give me clear information, onActivityResult it is not called. This only happens in Android 8.0(Huawei P8) and 9.0(Pixel 3XL) but not in Android 8.0(Moto e5) or Android 7.1.2(Xiaomi Redmi 4A).

Camera intent

private void cameraIntent() {
    Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(intent, CAMERA);
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (resultCode == Activity.RESULT_OK) {
        switch (requestCode) {
            case CAMERA:
                placeholder.setVisibility(View.GONE);
                bitmapImg = (Bitmap) data.getExtras().get("data");
                bitmapImg = scaleDown(bitmapImg, 800, true);
                imageExist = true;
                imageView.setImageBitmap(bitmapImg);
                menu.findItem(R.id.rotate_photo_gallery).setVisible(true);
                break;
        }
    }
}

Crash logs

  --------- beginning of crash
2019-04-12 15:54:47.444 28783-28783/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.google.android.GoogleCamera, PID: 28783
    java.lang.NullPointerException
        at oag.b(PG:232)
        at nre.b(PG:1)
        at ekm.e(PG:5)
        at ekm.c(PG:37)
        at czm.b(PG:13)
        at czm.a(PG:33)
        at egn.onShutterButtonClick(PG:9)
        at jry.onShutterButtonClick(PG:16)
        at com.google.android.apps.camera.ui.shutterbutton.ShutterButton.performClick(PG:498)
        at android.view.View.performClickInternal(View.java:6574)
        at android.view.View.access$3100(View.java:778)
        at android.view.View$PerformClick.run(View.java:25885)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2019-04-12 15:54:47.450 1165-2517/? W/ActivityManager:   Force finishing activity com.google.android.GoogleCamera/com.android.camera.activity.CaptureActivity
2019-04-12 15:54:47.453 28783-28783/? I/Process: Sending signal. PID: 28783 SIG: 9
2019-04-12 15:54:47.471 1165-1179/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
2019-04-12 15:54:47.471 1165-1179/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
2019-04-12 15:54:47.474 1165-1181/? I/ActivityManager: Start proc 28990:com.google.android.GoogleCamera:crash_report/u0a112 for service com.google.android.GoogleCamera/com.google.android.apps.camera.app.silentfeedback.SilentFeedbackService
2019-04-12 15:54:47.480 1165-1353/? W/InputDispatcher: channel '6ea5f67 com.google.android.GoogleCamera/com.android.camera.activity.CaptureActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
2019-04-12 15:54:47.481 1165-1353/? E/InputDispatcher: channel '6ea5f67 com.google.android.GoogleCamera/com.android.camera.activity.CaptureActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2019-04-12 15:54:47.488 28990-28990/? E/ra:crash_repor: Not starting debugger since process cannot load the jdwp agent.
Fishy
  • 1,275
  • 1
  • 12
  • 26
Sweetah
  • 21
  • 3

0 Answers0