You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/08/12 08:42:48 UTC

[GitHub] [cordova-plugin-camera] jfoclpf opened a new issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

jfoclpf opened a new issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756


   Just to let you know that some of the very recent commits are breaking the build. I can't precise which but after checking the commit history they should be from Aug 11, 2021 or Aug 9, 2021, but not fully sure.
   
   In my `package.json` I was fetching this plugin directly from the latest dev version here on github and not from npm, and since few days ago the building is breaking.
   
   I know it comes from here because when I fetch this plugin from npm, it doesn't break. Since the break seems to come from plugin `cordova-plugin-simple-image-resizer` it would be preferable to keep the plugin `cordova-plugin-camera` *always* backward compatible.
   
   The error log:
   
   ```
   /home/vagrant/build/com.in.my.district/platforms/android/app/src/main/java/info/protonet/imageresizer/ImageResizer.java:15: error: package org.apache.cordova.camera does not exist
   import org.apache.cordova.camera.FileHelper;
                                   ^
   /home/vagrant/build/com.in.my.district/platforms/android/app/src/main/java/info/protonet/imageresizer/ImageResizer.java:161: error: cannot find symbol
               BitmapFactory.decodeStream(FileHelper.getInputStreamFromUriString(uriString, cordova), null, options);
                                          ^
     symbol:   variable FileHelper
     location: class ImageResizer
   /home/vagrant/build/com.in.my.district/platforms/android/app/src/main/java/info/protonet/imageresizer/ImageResizer.java:168: error: cannot find symbol
               Bitmap unscaledBitmap = BitmapFactory.decodeStream(FileHelper.getInputStreamFromUriString(uriString, cordova), null, options);
                                                                  ^
     symbol:   variable FileHelper
     location: class ImageResizer
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   Note: /home/vagrant/build/com.in.my.district/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
   Note: Recompile with -Xlint:unchecked for details.
   3 errors
   FAILURE: Build failed with an exception.
   * What went wrong:
   Execution failed for task ':app:compileReleaseJavaWithJavac'.
   ```
   
   Full error log [here](https://gitlab.com/linsui/fdroiddata/-/jobs/1490357882).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf edited a comment on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf edited a comment on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897502110


   @erisu I'm using already cordova 10 and BTW many useful plugins are working fine but are abandoned. This IMO it's very important to make this core plugins backward compatible 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] erisu commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
erisu commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897504688


   Cordova 10 and Cordova-Android 10.x are two different things.
   
   If you run the command `cordova platform` or `cordova info` in the project directory, you will see what version of Android platform you have installed.
   
   E.g.
   
   ```
   $ cordova platform 
   
   Installed platforms:
     android 10.0.1
   ```
   
   ```
   $ cordova info
   
   Cordova Packages:
   
       cli: 10.0.0
           common: 4.0.2
           create: 3.0.0
           lib: 10.0.0
               common: 4.0.2
               fetch: 3.0.1
               serve: 4.0.0
   
   Project Installed Platforms:
   
       android: 10.0.1
   
   Project Installed Plugins:
   
       cordova-plugin-camera: 6.0.0-dev
       cordova-plugin-simple-image-resizer: 0.1.1
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] breautek commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897616026


   >  "cordova-android": "^9.1.0",
   
   Is incompatible with the latest version of the camera plugin.
   
   > The issue is not with cordova-plugin-simple-image-resizer because it's not touched for ages and actually they recommend to use the stable version of this plugin, check here.
   
   Git commits are not considered stable versions of the plugin. Apache has a voting process for releases where we (Commitee members) vote in good faith that what we are releasing is of acceptable quality and an improvement to the previous release. These releases are tagged under the `rel/x.y.z` and are then published to NPM. Only these releases are considered stable releases.
   
   Recommending the master branch for plugin installation is horrible advice from the plugin author.
   
   > it would be preferable to keep the plugin cordova-plugin-camera always backward compatible.
   
   This is an unrealistic expectation. While Cordova strives to maintain backward compatibility as much as possible, there are instances where this is simply not possible. For instance, to keep up with the modern SDK requirements, we need to start removing support for the legacy support libraries and start using the newer androidx libraries instead. These libraries are not backwards compatible, that is you can't have androidx libraries at the same time as legacy android support libraries.
   
   When Apache does release breaking changes, it will always be in a major version. It's up to plugin authors to declare a range of versions it supports instead of blindly claiming support against the latest version.
   
   > Do I really need to do cordova platform add android@latest
   
   Cordova CLI is pinned to whatever the latest major version release of each platform at the time of it's release. In this case, cordova-android@9 was the latest release so when cordova CLI was released, it's pinned against cordova-android@9 and thus if no version was declared, by default it will choose the pinned version as we know that is an cordova-android version that works against that version of the CLI.
   
   It's done this way because Apache obviously cannot guarentee that every newer version released after a particular CLI version will work properly, (e.g: cordova-android@11, cordova-android@12, ...). In this case, cordova-android@10 was released with cordova@10 being the latest CLI tools so it was tested against cordova-android@10 so we know the platform and the CLI tools works together. But updating the CLI tools to be pinned against cordova-android@10 would be a breaking change in itself, so the CLI tools will remained pin against cordova-android@9 until the next major release.
   
   Furthermore, [FileHelper](https://github.com/apache/cordova-plugin-camera/blob/master/src/android/FileHelper.java) class was not removed from this plugin. As Erisu said before, the upcoming major release of the camera plugin will not install on cordova-android@9 because they are incompatible. Therefore this isn't a bug and is working as intended.
   
   I'd refer to [Erisu's comment](https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897503615) for your workarounds to your particular issue.
   
   Kind regards,
   Norman


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] breautek closed issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
breautek closed issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897502110


   @erisu I'm using already cordova 10


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897506814


   Now I am not in front of my computer but you can check my package.json here
   
   https://github.com/jfoclpf/in-my-district/blob/main/package.json
   
   
   
   A quinta, 12/08/2021, 11:56, エリス ***@***.***> escreveu:
   
   > Cordova 10 and Cordova-Android 10.x are two different things.
   >
   > If you run the command cordova platform or cordova info in the project
   > directory, you will see what version of Android platform you have installed.
   >
   > E.g.
   >
   > $ cordova platform
   >
   > Installed platforms:
   >   android 10.0.1
   >
   > $ cordova info
   >
   > Cordova Packages:
   >
   >     cli: 10.0.0
   >         common: 4.0.2
   >         create: 3.0.0
   >         lib: 10.0.0
   >             common: 4.0.2
   >             fetch: 3.0.1
   >             serve: 4.0.0
   >
   > Project Installed Platforms:
   >
   >     android: 10.0.1
   >
   > Project Installed Plugins:
   >
   >     cordova-plugin-camera: 6.0.0-dev
   >     cordova-plugin-simple-image-resizer: 0.1.1
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897504688>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AA6M4DI4PBH35F2FFBF3EXLT4OLDLANCNFSM5CATGMLQ>
   > .
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897457807


   @erisu please take a look on this, since you made the recent commits


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf edited a comment on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf edited a comment on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897457807


   @erisu @dpa99c and @breautek  please take a look on this, since you made the recent commits


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] erisu commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
erisu commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897465947


   It appears the plugin is not installing for you.
   
   You should never use the dev or master branch for a production app. It should only be used for testing.
   
   If a third-party plugin is using this plugin as a dependency and pointing to the repo's master branch, then you should request to the plugin developers to fix this and use a stable release. 
   
   Master can become unstable or broken at any point during development and may not be fixed immediately.
   
   Also, the master branch has already been bumped for the next major release and will only support Cordova-Android 10.x and greater. You should upgrade your platform or downgrade the plugin version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897605837


   @erisu [this](https://github.com/jfoclpf/form-for-parking-violation/runs/3305802097?check_suite_focus=true) is the log of the build from the CI that broke and [this](https://github.com/jfoclpf/form-for-parking-violation/blob/master/.github/workflows/android.yml) is the YML config action file.
   
   I amended the VM config file to output the `cordova info` and you're right
   
   ```
   Cordova Packages:
   
       cli: 10.0.0
           common: 4.0.2
           create: 3.0.0
           lib: 10.0.0
               common: 4.0.2
               fetch: 3.0.1
               serve: 4.0.0
   
   Project Installed Platforms:
   
       android: 9.1.0
   ```
   
   I don't understand why is not fetching the latest if the ubuntu VM for tests is doing
   
   ```
   sudo apt install android-sdk -y
   npm install -g cordova
   cordova platform add android
   cordova build android --production
   ```
   
   
   Do I really need to do  `cordova platform add android@latest` 
   
   `cordova platform add android` does not suffice?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897926780


   Thank you Norman for the clarification. Thus the latest version of `cordova-plugin-camera` was still compatible with `android: 9.1.0` up to a very recent commit. Now I know it's incompatible and it's supposed to be.
   
   Kind regards
   João 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jfoclpf commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
jfoclpf commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897479589


   @erisu sure I know I shouldn't use dev version for production. But I was using it don't know why, and that's why I could find this bug :)
   
   The issue is not with `cordova-plugin-simple-image-resizer` because it's not touched for ages and actually they recommend to use the stable version of this plugin, check [here](https://github.com/JoschkaSchulz/cordova-plugin-image-resizer/search?q=camera).
   
   I'm just saying [this line](https://github.com/JoschkaSchulz/cordova-plugin-image-resizer/blob/89dfa8f0c97ba022b6598d80ce54f15178df1d2f/src/android/ImageResizer.java#L16) is breaking
   
   ```
   import org.apache.cordova.camera.FileHelper;
   ```
   
   @PieterVanPoyer I think it was your commit 75bf80726190a98002216bb271ffce45cd48ecb5 that broke the build or maybe c7971d9f63476e779e0e62f8722c601bf79f5bbb from @timbru31 and @breautek but I'm not sure. Could you kindly check?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] erisu commented on issue #756: The new commits are breaking the build (package org.apache.cordova.camera does not exist; import org.apache.cordova.camera.FileHelper;)

Posted by GitBox <gi...@apache.org>.
erisu commented on issue #756:
URL: https://github.com/apache/cordova-plugin-camera/issues/756#issuecomment-897503615


   There is no issue with the recent commits. I can build successfully with the master branch of this plugin and Cordova-Android 10.x. I also can build with the third-party plugin you are mentioning.
   
   As I have said, the issue is that you are using most likely an older version of the Android platform which is not supported with the master branch of this plugin. When you try to use an unsupported version, the plugin will not be installed and lead to these imported errors.
   
   Your two options are:
   
   A.  Upgrade your Platform
   
   ```
   cordova platform rm android
   cordova platform add android@latest
   ```
   
   This will install the latest Cordova-Android 10.0.1 platform which the master branch of this plugin will work for.
   
   B. Downgrade the Camera plugin
   
   ```
   cordova plugin rm cordova-plugin-camera
   cordova plugin add cordova-plugin-camera@5.0.3
   ```
   
   Stop using the master branch of this plugin and use the last stable release which supports Cordova-Android <= 9.x.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org