From issues-return-93382-apmail-cordova-issues-archive=cordova.apache.org@cordova.apache.org Wed Mar 14 19:50:02 2018 Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E87751851B for ; Wed, 14 Mar 2018 19:50:02 +0000 (UTC) Received: (qmail 75080 invoked by uid 500); 14 Mar 2018 19:50:02 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 75052 invoked by uid 500); 14 Mar 2018 19:50:02 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 75034 invoked by uid 99); 14 Mar 2018 19:50:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2018 19:50:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 49CE7C642C for ; Wed, 14 Mar 2018 19:50:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id P0QLBDyBn0kH for ; Wed, 14 Mar 2018 19:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E4C115F2ED for ; Wed, 14 Mar 2018 19:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4EE9CE00C8 for ; Wed, 14 Mar 2018 19:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0E9602148B for ; Wed, 14 Mar 2018 19:50:00 +0000 (UTC) Date: Wed, 14 Mar 2018 19:50:00 +0000 (UTC) From: "Joe Bowser (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-13974) With cordova-android 7.x plugins with jni libraries are not backwards compatible MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-13974?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D163992= 01#comment-16399201 ]=20 Joe Bowser commented on CB-13974: --------------------------------- I'm not at all surprised that this is breaking, since we've asked on Cordov= a list as well as in the Cordova Slack for people to test JNI and had zero = responses last year.=C2=A0 There probably should be something re-mapping th= e JNI plugins to the new location like what we do with all our legacy plugi= ns using Java.=C2=A0 I don't want to add custom path directives, since that= 's what we've been doing for the past three years keeping the old project s= tructure that keeps breaking in Android Studio. I can't really give an ETA on this, but you may have to publish a hook, or = two versions of the plugin.=C2=A0 Realistically, I don't see much support f= or Cordova-Android 6.x happening beyond security fixes in the near term. > With cordova-android 7.x plugins with jni libraries are not backwards com= patible > -------------------------------------------------------------------------= ------- > > Key: CB-13974 > URL: https://issues.apache.org/jira/browse/CB-13974 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-android > Affects Versions: cordova-android-7.0.0 > Reporter: Doug Davies > Assignee: Joe Bowser > Priority: Major > Attachments: image1.png, image2.png, image3.png > > > Pull down my project on GitHub > [https://github.com/funkyvisions/manatee-tester.git] > It uses the 3rd party plugin (manateeworks-barcodescanner-v3) which IS co= mpatible with cordova-android 6.4.0. > Execute the following: > {code:java} > =C2=A0 =C2=A0 cordova prepare > cordova build android{code} > You'll see everything prepares and builds fine and you can see the librar= ies (.so files and jar) end up in the correct directories in the APK (view = through Android Studio - Build -> Analyze APK). See image1. > Now we are going to switch to cordova-android 7.1.0. > Execute the following:=C2=A0 > {code:java} > cp package.7.json package.json > =C2=A0 =C2=A0cp config.7.xml config.xml > =C2=A0 =C2=A0rm -rf platforms plugins > =C2=A0 =C2=A0cordova prepare > =C2=A0 =C2=A0cordova build android > {code} > Notice it fails. This is because the plugin.xml is incorrect (although th= e error would never lead you to discover this). So let's fix it. Unfortunat= ely, I tried to fork the project and apply a patch, but there seems to be a= bug with cordova-fetch (https://issues.apache.org/jira/browse/CB-13973), s= o instead I included it locally in this project along with the patch to plu= gin.xml. > I changed these lines in plugin.xml: > {code:java} > > > > > > > > > > > > > > > {code} > to this: > {code:java} > > > > > > > > > > > > > > > > > > > > > {code} > Now let's switch to the forked version of the plugin and see if it works. > Execute the following: > {code:java} > cp package.fork.json package.json > =C2=A0 =C2=A0cp config.fork.xml config.xml > =C2=A0 =C2=A0rm -rf platforms plugins > =C2=A0 =C2=A0cordova prepare > =C2=A0 =C2=A0cordova build android{code} > Now you see it builds once again and the APK is correct. See image2. > However, the directives I put in plugin.xml are not backwards compatible = with 6.4.0. We can prove this by now switch back to cordova-android 6.4.0 a= nd trying to build. > {code:java} > =C2=A0 =C2=A0 cp package.6.json package.json > =C2=A0 =C2=A0cp config.6.xml config.xml > =C2=A0 =C2=A0rm -rf platforms plugins > =C2=A0 =C2=A0cordova prepare > =C2=A0 =C2=A0cordova build android{code} > Now look at the APK and you will see the libraries are missing. See image= 3. > In order to fix this, I have to create a mix on the old config plus the n= ew. > See [https://github.com/funkyvisions/phonegap-manateeworks-v3/commit/9f3b= 165832141e45fa2c2e92dbf62b2300f0caf2#diff-53f390d375398624afe1cfe1125f42bf] > I don't think this is a very good solution. > There needs to be an approach that works with both. I wonder if this (htt= ps://issues.apache.org/jira/browse/CB-8781) is missing from cordova-android= 7.1.0: > {code:java} > jniLibs.srcDirs =3D ['libs']{code} > =C2=A0 > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org