apache / cordova-plugin-camera

Apache Cordova Plugin camera
https://cordova.apache.org/
Apache License 2.0
960 stars 1.52k forks source link

android 13 camera open issue #840

Closed rokanraja1 closed 8 months ago

rokanraja1 commented 10 months ago

Bug Report

Problem

What is expected to happen?

android 13 camera open to chose the image.

What does actually happen?

android 13 camera open, but no actions.

Environment, Platform, Device

Ionic 5(Angular 11)

Version information

Cordova: 12 Cordova-Android- 12

Checklist

rokanraja1 commented 10 months ago

https://github.com/apache/cordova-plugin-camera/pull/839

hiteshbasware commented 9 months ago

Can someone do us a favour and please merge the fix from #839.

As android is forcing mobile apps to upgrade to support API level 33 many will be getting the same issue.

839

Thanks for this amazing workaround

rokanraja1 commented 9 months ago

Hello What's the issue happening I didn't understand

On 21-Jul-2023 2:57 pm, hiteshbasware @.***> wrote:

Can someone do us a favour and please merge the fix from #839https://github.com/apache/cordova-plugin-camera/pull/839.

As android is forcing mobile apps to upgrade to support API level 33 many will be getting the same issue.

839https://github.com/apache/cordova-plugin-camera/pull/839

Thanks for this amazing workaround

— Reply to this email directly, view it on GitHubhttps://github.com/apache/cordova-plugin-camera/issues/840#issuecomment-1645288500, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5WIOIDDM7NHWF2IBYSRQJDXRJDPNANCNFSM6AAAAAA2LIMHJ4. You are receiving this because you were mentioned.Message ID: @.***>

hiteshbasware commented 9 months ago

Hello What's the issue happening I didn't understand On 21-Jul-2023 2:57 pm, hiteshbasware @.> wrote: Can someone do us a favour and please merge the fix from #839<#839>. As android is forcing mobile apps to upgrade to support API level 33 many will be getting the same issue. #839<#839> Thanks for this amazing workaround — Reply to this email directly, view it on GitHub<#840 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5WIOIDDM7NHWF2IBYSRQJDXRJDPNANCNFSM6AAAAAA2LIMHJ4. You are receiving this because you were mentioned.Message ID: @.>

I got somewhat similar issue camera was not even opening for me, after your fix it worked but thats still not merged into master.

rokanraja1 commented 9 months ago

Yes I don't know why they are not merge the code

On 24-Jul-2023 12:37 pm, hiteshbasware @.***> wrote:

Hello What's the issue happening I didn't understand On 21-Jul-2023 2:57 pm, hiteshbasware @.> wrote: Can someone do us a favour and please merge the fix from #839https://github.com/apache/cordova-plugin-camera/pull/839<#839https://github.com/apache/cordova-plugin-camera/pull/839>. As android is forcing mobile apps to upgrade to support API level 33 many will be getting the same issue. #839https://github.com/apache/cordova-plugin-camera/pull/839<#839https://github.com/apache/cordova-plugin-camera/pull/839> Thanks for this amazing workaround — Reply to this email directly, view it on GitHub<#840 (comment)https://github.com/apache/cordova-plugin-camera/issues/840#issuecomment-1645288500>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5WIOIDDM7NHWF2IBYSRQJDXRJDPNANCNFSM6AAAAAA2LIMHJ4. You are receiving this because you were mentioned.Message ID: @.>

I got somewhat similar issue camera was not even opening for me, after your fix it worked but thats still not merged into master.

— Reply to this email directly, view it on GitHubhttps://github.com/apache/cordova-plugin-camera/issues/840#issuecomment-1647334292, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5WIOICO5UNAX7X6DWX6JYDXRYNLBANCNFSM6AAAAAA2LIMHJ4. You are receiving this because you were mentioned.Message ID: @.***>

templatetuners commented 9 months ago

after this patch i am getting this error:

...\android\platforms\android\app\src\main\java\org\apache\cordova\camera\CameraLauncher.java:1325: error: method getImage in class CameraLauncher cannot be applied to given types;
                        this.getImage(this.srcType, this.destType, this.encodingType);
                            ^
  required: int,int
  found:    int,int,int
  reason: actual and formal argument lists differ in length
...\android\platforms\android\app\src\main\java\org\apache\cordova\camera\CameraLauncher.java:1343: error: method getImage in class CameraLauncher cannot be applied to given types;
                    this.getImage(this.srcType, this.destType, this.encodingType);
                        ^
  required: int,int
  found:    int,int,int
  reason: actual and formal argument lists differ in length

tried adding int encodingType here line 363

public void getImage(int srcType, int returnType, int encodingType) {

and on line 201 encodingType

this.getImage(this.srcType, destType, encodingType);

now i can build but camera / library still not opening

my bad here, i am on beta android 14 so need this too

if(Integer.parseInt(version) == 13 || Integer.parseInt(version) == 14) {

zubus commented 9 months ago

Hi @templatetuners could you fix the error with those modifications?

veronicatc commented 9 months ago

I could get the camera plugin working when targetting api 33 (android 13 ) when using this fork:

https://github.com/DaedalusDev/cordova-plugin-camera/

mentioned in this issue:

https://github.com/apache/cordova-plugin-camera/issues/826

Tested the app on a device with android 12 and on an emulator running android 13, worked on both.

hiteshbasware commented 9 months ago

I could get the camera plugin working when targetting api 33 (android 13 ) when using this fork:

https://github.com/DaedalusDev/cordova-plugin-camera/

mentioned in this issue:

826

Tested the app on a device with android 12 and on an emulator running android 13, worked on both.

@veronicatc - you can also check https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-1655611206 There are additional fixes in the fork mentioned here.

clarklight commented 9 months ago

I could get the camera plugin working when targetting api 33 (android 13 ) when using this fork:

https://github.com/DaedalusDev/cordova-plugin-camera/

mentioned in this issue:

826

Tested the app on a device with android 12 and on an emulator running android 13, worked on both.

I just tested it, and works fine for me too, can open camera, and open photo album, all works fine, can we push this version to Prod, merge into the master etc? I saw lots of people asking about it... Thanks Clark

hieunguyen2211 commented 9 months ago

I could get the camera plugin working when targetting api 33 (android 13 ) when using this fork:

https://github.com/DaedalusDev/cordova-plugin-camera/

mentioned in this issue:

826

Tested the app on a device with android 12 and on an emulator running android 13, worked on both.

Just tested it and works fine for me too. Is there any update regarding version 7.0.0?

Thanks in advance.

rokanraja1 commented 8 months ago

Hello Everyone Test Failed adjust done

LucasBourgeois commented 8 months ago

Release 7.0.0 is needed as Google is preventing updates tomorrow if 33 api lvl isnt targeted and with no release of this, the plugin isnt usable

clarklight commented 8 months ago

@LucasBourgeois https://github.com/apache/cordova-plugin-camera/pull/844 They just updated it 5 days ago? its 7.0.0-dev

dogofpavlov commented 8 months ago

Just curious when will 7.0.0 be officially released? I'd prefer to use that over a 7.0.0-dev and as LucasBourgeois mentioned as of today all Android apps MUST submit with api lvl 33.

LucasBourgeois commented 8 months ago

@dogofpavlov you Can Ask Google in play console for an additional delay of 2months ! It's what i did.

@clarklight a dev version isnt meant for production

I guess we just have to wait or use a fork until 7.0 is released....

jessyefuster commented 8 months ago

@LucasBourgeois fyi I managed to ask for additional delay ONLY on existing app that already had a version published, so in the context of an app update. For first time publication it seems that your build MUST target api 33, I couldn't find a way to request a delay

LucasBourgeois commented 8 months ago

Yes there is no possible delay for new app. (But any new app shouldn't use cordova nowadays imo)

kaeverens commented 8 months ago

new version of this plugin just released about an hour ago.

I found that it works if you remove line 58 of the plugin.xml before compiling your Android platform. if you don't remove that line, then your compilation may complain about a "duplicate" erquest for permission WRITE_EXTERNAL_STORAGE

breautek commented 8 months ago

Should be fixed by https://github.com/apache/cordova-plugin-camera/pull/844

if you don't remove that line, then your compilation may complain about a "duplicate" erquest for permission WRITE_EXTERNAL_STORAGE

Conflicts may happen regardless. It will depend on the plugins being used in your project and how they declare permissions. If any plugin declares the same permission with a different configuration than the other, a conflict will be raised in AAPT during build.

A hook script might be required to remove duplicates as part of your build process.

jessyefuster commented 8 months ago

@breautek I don't know about this plugin release process, but do you have any idea on why the 7.0.0 is not showing up on npm ?

breautek commented 8 months ago

@breautek I don't know about this plugin release process, but do you have any idea on why the 7.0.0 is not showing up on npm ?

Because it's not released yet.

In short, all apache releases needs to go through (at minimum ) 72 (or 48? I'd have to refer to the actual Apache policy to be sure) hour vote thread to give opportunity for project members across timezones to respond and cast their vote. Once the vote thread is closed, the member making the release will create a rel/ tag for the release and publish the package to NPM.

Community members may also cast their vote as a non-binding vote. The vote thread is located on our dev mailing list (https://lists.apache.org/thread/gcvv0zf1rs1svvdv9pjffwdwx7yn69fd). Subscribing to the mailing list can be done here.

breautek commented 8 months ago

I found that it works if you remove line 58 of the plugin.xml before compiling your Android platform. if you don't remove that line, then your compilation may complain about a "duplicate" erquest for permission WRITE_EXTERNAL_STORAGE

For this, you can use a after_prepare hook:

https://gist.github.com/breautek/bd157b8598f9a816f2ec0d45e3d932c8

jessyefuster commented 8 months ago

@breautek Thank you so much for the explanation, now I know how it works 😄 Btw thank you all for your work on cordova plugins

awreese commented 8 months ago

@breautek I don't know about this plugin release process, but do you have any idea on why the 7.0.0 is not showing up on npm ?

Because it's not released yet.

In short, all apache releases needs to go through (at minimum ) 72 (or 48? I'd have to refer to the actual Apache policy to be sure) hour vote thread to give opportunity for project members across timezones to respond and cast their vote. Once the vote thread is closed, the member making the release will create a rel/ tag for the release and publish the package to NPM.

Community members may also cast their vote as a non-binding vote. The vote thread is located on our dev mailing list (https://lists.apache.org/thread/gcvv0zf1rs1svvdv9pjffwdwx7yn69fd). Subscribing to the mailing list can be done here.

So it would appear to have been longer than 48-72 hours. Any update when this version will be available in NPM?