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

Photo from camera: crash Android 11 #19

Open
mgursch opened this issue Sep 30, 2020 · 5 comments
Open

Photo from camera: crash Android 11 #19

mgursch opened this issue Sep 30, 2020 · 5 comments

Comments

@mgursch
Copy link

mgursch commented Sep 30, 2020

Hello

I have Android 11 installed on my Pixel 2.
Every time I try to select picture by camera the library crashes with the following stacktrace:

2020-09-30 11:08:05.444 7462-7462/com.landwirt E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.landwirt, PID: 7462
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.landwirt/lv.chi.photopicker.utils.CameraActivity}: java.lang.IllegalStateException: intent.resolveActivity(packageManager) must not be null
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.IllegalStateException: intent.resolveActivity(packageManager) must not be null
at lv.chi.photopicker.utils.CameraActivity.requestImageCapture(CameraActivity.kt:85)
at lv.chi.photopicker.utils.CameraActivity.onCreate(CameraActivity.kt:30)
at android.app.Activity.performCreate(Activity.java:8000)
at android.app.Activity.performCreate(Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)

@mgursch
Copy link
Author

mgursch commented Sep 30, 2020

Solution is to add the following lines to AndroidManifest





is there any way to provide this through the library or add this at least to readme

@paolorotolo
Copy link

For others having the same issue, the lines to add to AndroidManifest are the following:

    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
    </queries>

@paolorotolo
Copy link

This is fixed by #24

@roiskhoiron
Copy link

For others having the same issue, the lines to add to AndroidManifest are the following:

    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
    </queries>

Nice ! its work for me

@danc243
Copy link

danc243 commented Sep 6, 2021

For others having the same issue, the lines to add to AndroidManifest are the following:

    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
    </queries>

Works for me!

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

No branches or pull requests

4 participants