Cannot run project after maven migration

125 views
Skip to first unread message

Carlos Verdier

unread,
May 10, 2021, 9:59:51 AM5/10/21
to CodenameOne Discussions
One of my project fails to run and throws this error:

Reading program jar [/Users/carlos/Proyectos CodenameOne/review/common/target/compliance-check.jar] (filtered)
Error: Can't read [/Users/carlos/Proyectos CodenameOne/review/common/target/compliance-check.jar] (Can't process class [net/sf/zipme/ZipInputStream.class] (Unexpected end of ZLIB input stream))

Any idea?

Thanks

Steve Hannah

unread,
May 10, 2021, 10:03:44 AM5/10/21
to codenameone...@googlegroups.com
Run "clean" on the project (or at least the "common" module - i.e. delete the common/target directory).  Then build again.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/6a34f448-dc45-4a4e-b25c-e5cbcfef5db8n%40googlegroups.com.


--
Steve Hannah
Software Developer
Codename One

Carlos Verdier

unread,
May 10, 2021, 10:09:54 AM5/10/21
to codenameone...@googlegroups.com
Thanks

Now the error has changed:

Error: Can't write [/Users/carlos/Proyectos CodenameOne/review/common/target/compliance-check.jar] (Can't read [/Users/carlos/Proyectos CodenameOne/review/cn1libs/cn1-codescan/jars/main.zip(;;;;;;;!META-INF/**)] (Duplicate jar entry [com/codename1/ext/codescan/NativeCodeScanner.class]))

Steve Hannah

unread,
May 10, 2021, 10:12:55 AM5/10/21
to codenameone...@googlegroups.com
Do you have multiple dependencies for the codescanner lib?  Check the dependencies section of your common/pom.xml file to make sure you don't have duplicates.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

Carlos Verdier

unread,
May 10, 2021, 10:27:22 AM5/10/21
to CodenameOne Discussions
No Just one entry:

    <!-- Add your cn1lib dependencies to this section -->
    <dependencies>
        <dependency>
            <groupId>com.codenameone</groupId>
            <artifactId>codenameone-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
  <artifactId>review-QRScanner</artifactId>
  <groupId>com.yourappeasy.reviewer</groupId>
  <version>1.0-SNAPSHOT</version>
  <type>pom</type>
</dependency>

<dependency>
  <artifactId>review-CN1CircleProgress</artifactId>
  <groupId>com.yourappeasy.reviewer</groupId>
  <version>1.0-SNAPSHOT</version>
  <type>pom</type>
</dependency>

<dependency>
  <artifactId>review-ZipSupport</artifactId>
  <groupId>com.yourappeasy.reviewer</groupId>
  <version>1.0-SNAPSHOT</version>
  <type>pom</type>
</dependency>

<dependency>
  <artifactId>review-Connectivity</artifactId>
  <groupId>com.yourappeasy.reviewer</groupId>
  <version>1.0-SNAPSHOT</version>
  <type>pom</type>
</dependency>

<dependency>
  <artifactId>review-cn1-codescan</artifactId>
  <groupId>com.yourappeasy.reviewer</groupId>
  <version>1.0-SNAPSHOT</version>
  <type>pom</type>
</dependency>

<dependency>
  <artifactId>review-AnimatedGifSupport</artifactId>
  <groupId>com.yourappeasy.reviewer</groupId>
  <version>1.0-SNAPSHOT</version>
  <type>pom</type>
</dependency>


Steve Hannah

unread,
May 10, 2021, 10:40:44 AM5/10/21
to codenameone...@googlegroups.com
Looks like the QRScanner lib includes its own copies of the cn1-codescan classes, which makes it conflict. 

This is problematic.  I'm not sure if the solution is that it no longer depends on cn1-codescan (i.e. remove the cn1-codescan dependency), or if those classes need to renamed in the QRScanner lib, or if those classes need to be removed in the QRScanner lib.

The compliance check complains about duplicate classes because it uses proguard - and I haven't figured out a way to tell it *not* to complain about this.  But it is technically correct.   Having duplicates is going to bite you down the road, especially since they probably aren't identical, so behaviour is undefined.

You can "turn off" the compliance check by looking for "<goal>compliance-check</goal>" in your common/pom.xml file, but this is not a good long-term solution since that disables compile-time checks for compliance with supported APIs, and it may just kick the can to the build server.

Judging by the QRCodescanner lib repo, I suspect there will be other problems as it hasn't been updated in 5 years.  It is highly likely that it some other aspects may run afoul of current Google and iOS appstore acceptance standards.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

Carlos Verdier

unread,
May 10, 2021, 10:48:42 AM5/10/21
to CodenameOne Discussions
Is there any other way to scan QR Codes that is supported directly by CN1? Having to depend on third party libraries that are no longer updated is not ideal for me, and currently don't have the time to fork the lib.

Shai Almog

unread,
May 10, 2021, 11:16:10 PM5/10/21
to CodenameOne Discussions
The intent approach is the one used by most Android apps. One of the reasons the littlemonkey lib is failing is because it's so hard to maintain.
You can fork and fix it.
We also have this https://github.com/shannah/cn1-codescan-scandit which is actually far more advanced but the company that makes the underlying library charges a lot for it.
Reply all
Reply to author
Forward
0 new messages