You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Chris Brody <ch...@gmail.com> on 2020/06/08 02:48:18 UTC

Modernize cordova-android build?

It looks like cordova-android expects Java/JDK 1.8 to be installed. But my
understanding is that it should be possible to use a newer OpenJDK version
such as 13. See this thread on Homebrew:
https://discourse.brew.sh/t/gradle-and-jdk-dependency/7969

As I said in that thread, I was able to use OpenJDK 13 with command-line
build on multiple Android projects outside of Cordova, including React
Native. But Cordova would show an error message like this:

Requirements check failed for JDK 8 ('1.8.*')! Detected version: 13.0.2

Another thing is that many build systems are now using a Gradle wrapper,
while Cordova still needs the Gradle tool to be installed in its search
path. This may be related to a nasty-looking issue here:
https://github.com/apache/cordova-android/issues/845

Incidentally if I would add cordova-android from GitHub, then I would be
able to build and run from Android Studio 4.0.0. But this does not seem to
work with current cordova-android@8 version.

I think these observations should be tracked in one or more issues on
GitHub.

Re: Modernize cordova-android build?

Posted by ra...@gmail.com.
Regarding Gradle: It would really be great if we could work around that "do
not distribute JARs" requirement. A good first step would be to see the
actual rule that forbids us to do this.

In the thread Darryl linked to there was a message exploring some possible
workarounds:

> Can we cheat and just have a script that uses curl/wget to retrieve Gradle
> from Apache's dist directory?
> Or, could we publish Gradle to npm and then have our thing depend on
> cordova-gradle ?


Both suggestions were left unaddressed as the discussion wandered off in
the direction of using Android Studio's bundled Gradle which IIRC we did
for a while before that stopped working.

But especially the second option seems quite feasible to me. Who says that
we cannot depend on some package that includes some form of binaries in its
distribution?

Am Mo., 8. Juni 2020 um 14:43 Uhr schrieb Tim Brust
<ti...@sinnerschrader.com.invalid>:

> +1 to Norman's statement. However, I believe the PR is not ready to be
> merged at the moment.
>
> On Mon, Jun 8, 2020 at 2:23 PM Norman Breau <no...@normanbreau.com>
> wrote:
>
> > Yes, I had a misunderstanding from the Android documentation, I think
> > you can use any JDK version as long as it's at least version 8, because
> > in the gradle config, we declare that we want to compile for JDK 1.8 at
> >
> >
> https://github.com/apache/cordova-android/blob/a830145f36c8bba2ecdf7910f3699116d4c2f018/framework/build.gradle#L58-L61
> >
> > I would +1 easing the restriction of the JDK version check so that it
> > allows JDK 8+ so users don't need to have multiple java environments
> > installed just to use Cordova. JDK8 end of life is also at the end of
> > this year.
> >
> > On 2020-06-08 5:04 a.m., julio cesar sanchez wrote:
> > > There is a PR to allow any jdk version, we mistakenly thought java 8
> was
> > > required for android development, but looks like we were wrong.
> > >
> > > https://github.com/apache/cordova-android/pull/928
> > >
> > >
> > > El lunes, 8 de junio de 2020, Darryl Pogue <da...@dpogue.ca>
> escribió:
> > >
> > >> On Sun, Jun 7, 2020 at 7:49 PM Chris Brody <ch...@gmail.com>
> > wrote:
> > >>> Another thing is that many build systems are now using a Gradle
> > wrapper,
> > >>> while Cordova still needs the Gradle tool to be installed in its
> search
> > >>> path. This may be related to a nasty-looking issue here:
> > >>> https://github.com/apache/cordova-android/issues/845
> > >> I seem to recall that we have to use the system-installed gradle to
> > >> generate our gradle wrapper, because the wrapper depends on a JAR file
> > >> and we're not allowed to distribute JAR files.
> > >>
> > >> Previous mailing list discussion regarding gradle wrapper
> distribution:
> > >> https://lists.apache.org/thread.html/9fcaf3cd6b22e9cd6d09e17ff5956b
> > >> f661c3560be923f734dcc4450e%401403096149%40%3Cdev.cordova.apache.org
> %3E
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > >> For additional commands, e-mail: dev-help@cordova.apache.org
> > >>
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > For additional commands, e-mail: dev-help@cordova.apache.org
> >
> >
>
> --
> Tim Brust, Product Engineer
>
> tim.brust@sinnerschrader.com
> T +49 40 398855 315
>
> SinnerSchrader Deutschland GmbH | SinnerSchrader Group
> Völckersstraße 38, 22765 Hamburg, Germany
>
> Amtsgericht Hamburg HRB-Nr. 63663
> Geschäftsführer: Matthias Schrader (Sprecher),
> Jürgen Alker, Dr. Axel Averdung, Holger Blank,
> Thomas Dyckhoff, Dr. Lars Finke, Martin Gassner, Peggy Hutchinson
>
> Büros: Berlin, Hamburg, Frankfurt a. M., München, Prag
>
> https://www.sinnerschrader.com | NEXT AGENCY
>

Re: Modernize cordova-android build?

Posted by Tim Brust <ti...@sinnerschrader.com.INVALID>.
+1 to Norman's statement. However, I believe the PR is not ready to be
merged at the moment.

On Mon, Jun 8, 2020 at 2:23 PM Norman Breau <no...@normanbreau.com> wrote:

> Yes, I had a misunderstanding from the Android documentation, I think
> you can use any JDK version as long as it's at least version 8, because
> in the gradle config, we declare that we want to compile for JDK 1.8 at
>
> https://github.com/apache/cordova-android/blob/a830145f36c8bba2ecdf7910f3699116d4c2f018/framework/build.gradle#L58-L61
>
> I would +1 easing the restriction of the JDK version check so that it
> allows JDK 8+ so users don't need to have multiple java environments
> installed just to use Cordova. JDK8 end of life is also at the end of
> this year.
>
> On 2020-06-08 5:04 a.m., julio cesar sanchez wrote:
> > There is a PR to allow any jdk version, we mistakenly thought java 8 was
> > required for android development, but looks like we were wrong.
> >
> > https://github.com/apache/cordova-android/pull/928
> >
> >
> > El lunes, 8 de junio de 2020, Darryl Pogue <da...@dpogue.ca> escribió:
> >
> >> On Sun, Jun 7, 2020 at 7:49 PM Chris Brody <ch...@gmail.com>
> wrote:
> >>> Another thing is that many build systems are now using a Gradle
> wrapper,
> >>> while Cordova still needs the Gradle tool to be installed in its search
> >>> path. This may be related to a nasty-looking issue here:
> >>> https://github.com/apache/cordova-android/issues/845
> >> I seem to recall that we have to use the system-installed gradle to
> >> generate our gradle wrapper, because the wrapper depends on a JAR file
> >> and we're not allowed to distribute JAR files.
> >>
> >> Previous mailing list discussion regarding gradle wrapper distribution:
> >> https://lists.apache.org/thread.html/9fcaf3cd6b22e9cd6d09e17ff5956b
> >> f661c3560be923f734dcc4450e%401403096149%40%3Cdev.cordova.apache.org%3E
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >> For additional commands, e-mail: dev-help@cordova.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

-- 
Tim Brust, Product Engineer

tim.brust@sinnerschrader.com
T +49 40 398855 315

SinnerSchrader Deutschland GmbH | SinnerSchrader Group
Völckersstraße 38, 22765 Hamburg, Germany

Amtsgericht Hamburg HRB-Nr. 63663
Geschäftsführer: Matthias Schrader (Sprecher),
Jürgen Alker, Dr. Axel Averdung, Holger Blank,
Thomas Dyckhoff, Dr. Lars Finke, Martin Gassner, Peggy Hutchinson

Büros: Berlin, Hamburg, Frankfurt a. M., München, Prag

https://www.sinnerschrader.com | NEXT AGENCY

Re: Modernize cordova-android build?

Posted by Norman Breau <no...@normanbreau.com>.
Yes, I had a misunderstanding from the Android documentation, I think 
you can use any JDK version as long as it's at least version 8, because 
in the gradle config, we declare that we want to compile for JDK 1.8 at 
https://github.com/apache/cordova-android/blob/a830145f36c8bba2ecdf7910f3699116d4c2f018/framework/build.gradle#L58-L61

I would +1 easing the restriction of the JDK version check so that it 
allows JDK 8+ so users don't need to have multiple java environments 
installed just to use Cordova. JDK8 end of life is also at the end of 
this year.

On 2020-06-08 5:04 a.m., julio cesar sanchez wrote:
> There is a PR to allow any jdk version, we mistakenly thought java 8 was
> required for android development, but looks like we were wrong.
>
> https://github.com/apache/cordova-android/pull/928
>
>
> El lunes, 8 de junio de 2020, Darryl Pogue <da...@dpogue.ca> escribió:
>
>> On Sun, Jun 7, 2020 at 7:49 PM Chris Brody <ch...@gmail.com> wrote:
>>> Another thing is that many build systems are now using a Gradle wrapper,
>>> while Cordova still needs the Gradle tool to be installed in its search
>>> path. This may be related to a nasty-looking issue here:
>>> https://github.com/apache/cordova-android/issues/845
>> I seem to recall that we have to use the system-installed gradle to
>> generate our gradle wrapper, because the wrapper depends on a JAR file
>> and we're not allowed to distribute JAR files.
>>
>> Previous mailing list discussion regarding gradle wrapper distribution:
>> https://lists.apache.org/thread.html/9fcaf3cd6b22e9cd6d09e17ff5956b
>> f661c3560be923f734dcc4450e%401403096149%40%3Cdev.cordova.apache.org%3E
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>

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


Re: Modernize cordova-android build?

Posted by julio cesar sanchez <jc...@gmail.com>.
There is a PR to allow any jdk version, we mistakenly thought java 8 was
required for android development, but looks like we were wrong.

https://github.com/apache/cordova-android/pull/928


El lunes, 8 de junio de 2020, Darryl Pogue <da...@dpogue.ca> escribió:

> On Sun, Jun 7, 2020 at 7:49 PM Chris Brody <ch...@gmail.com> wrote:
> >
> > Another thing is that many build systems are now using a Gradle wrapper,
> > while Cordova still needs the Gradle tool to be installed in its search
> > path. This may be related to a nasty-looking issue here:
> > https://github.com/apache/cordova-android/issues/845
>
> I seem to recall that we have to use the system-installed gradle to
> generate our gradle wrapper, because the wrapper depends on a JAR file
> and we're not allowed to distribute JAR files.
>
> Previous mailing list discussion regarding gradle wrapper distribution:
> https://lists.apache.org/thread.html/9fcaf3cd6b22e9cd6d09e17ff5956b
> f661c3560be923f734dcc4450e%401403096149%40%3Cdev.cordova.apache.org%3E
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

Re: Modernize cordova-android build?

Posted by Darryl Pogue <da...@dpogue.ca>.
On Sun, Jun 7, 2020 at 7:49 PM Chris Brody <ch...@gmail.com> wrote:
>
> Another thing is that many build systems are now using a Gradle wrapper,
> while Cordova still needs the Gradle tool to be installed in its search
> path. This may be related to a nasty-looking issue here:
> https://github.com/apache/cordova-android/issues/845

I seem to recall that we have to use the system-installed gradle to
generate our gradle wrapper, because the wrapper depends on a JAR file
and we're not allowed to distribute JAR files.

Previous mailing list discussion regarding gradle wrapper distribution:
https://lists.apache.org/thread.html/9fcaf3cd6b22e9cd6d09e17ff5956bf661c3560be923f734dcc4450e%401403096149%40%3Cdev.cordova.apache.org%3E

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