android-* packages not working well with OpenJDK 11

Bug #1820513 reported by Matthias Klose
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
android-platform-tools-base (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Committed
Undecided
Unassigned
Cosmic
Fix Committed
Undecided
Unassigned

Bug Description

android-* packages not working well with OpenJDK 11.

taken from
https://bugs.launchpad.net/ubuntu/+source/openhft-chronicle-threads/+bug/1814133/comments/96

Android builds are entirely broken with OpenJDK 11.

Apparently, you'd be forced to upgrade Android Gradle plugin to at least 3.1.0 to be compatible to OpenJDK 11. Ubuntu/Debian still has version 2.2.2 [1]!

But even if you upgrade to 3.1.0 manually (bypassing apt), you'd break reproducable builds. Versions 3.1 to 3.4 are dependent on file system sort order. According to Google, that bug has recently been fixed in 3.5 [2] and will be backported to 3.4, but anyway these versions require newer Gradle versions that have yet to appear in Ubuntu/Debian. So we have a dependency deadlock that is currently unresolvable.

[1] https://packages.ubuntu.com/search?keywords=libgradle-android-plugin-java&searchon=names
[2] https://issuetracker.google.com/issues/110237303

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in android-platform-tools-base (Ubuntu):
status: New → Confirmed
Matthias Klose (doko)
description: updated
description: updated
Revision history for this message
Matthias Klose (doko) wrote :

Andreas, two questions:

 - do the Android builds work in 18.04 LTS? with OpenJDK 10? OpenJDK 8?
 - do the packages in -proposed work with OpenJDK 8?

Changed in android-platform-tools-base (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Matthias Klose (doko) wrote :

One more thing: Please write down your test case here.

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

Hi Andres,

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Apart from what Matthias asked, please answer these questions:
* Is this reproducible?
* If so, what specific steps should we take to recreate this bug?

This will help us to find and resolve the problem.

We would appreciate if you could provide this information as soon as possible so we can properly prioritize this.

Revision history for this message
Andreas Schildbach (schildbach) wrote :

First, a clarification: I'm not yet using the android* packages for building my Android apps. I would very much like to, but they seemed incomplete and outdated whenever I checked.

Rather, I'm using the Android SDK downloaded from Google and brought up to date by running "sdkmanager --update".

But I do use the Ubuntu supplied Gradle 3.4.1, OpenJDK 8 packages as well as several standlone SDK tools like apksigner, apktool, adb and some more. I described everything in e.g. this README:

https://github.com/bitcoin-wallet/bitcoin-wallet/blob/master/wallet/README.md#building-the-development-version

So yes, the Android builds work with OpenJDK 8, Gradle 3.4.1 under Ubuntu 18.04 LTS. On OpenJDK 11, Gradle 4.4.1 under Ubuntu 18.04 LTS-proposed the described issues appear. All issues I reported are perfectly reproducable. I will test OpenJDK 10 in a moment, but from memory when I updated Bionic I had similar issues until I uninstalled OpenJDK 10 which fixed all problems I had.

Revision history for this message
Andreas Schildbach (schildbach) wrote :

Actually I don't find an openjdk-10-jdk[-headless] package in Bionic, so I'm not sure if I ever tested OpenJDK 10. Probably not.

Revision history for this message
Andreas Schildbach (schildbach) wrote :
Download full text (8.5 KiB)

For completeness, I just tested the combination Gradle 3.4.1 and OpenJDK 11, all from current Bionic (updated):

* I get the "WARNING: An illegal reflective access" spamming in the console. Reported separately:
  https://bugs.launchpad.net/ubuntu/+source/gradle/+bug/1803855
* The build breaks with
> Failed to notify project evaluation listener.
   > javax/xml/bind/annotation/XmlSchema

The full exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':sample-integration-android'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:89)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:76)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$000(LifecycleProjectEvaluator.java:33)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:53)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute(LifecycleProjectEvaluator.java:50)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:599)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:125)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuildAction.execute(DefaultGradleLauncher.java:233)
        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuildAction.execute(DefaultGradleLauncher.java:230)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:160)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner...

Read more...

Revision history for this message
Andreas Schildbach (schildbach) wrote :

Does this answer your questions?

Revision history for this message
Matthias Klose (doko) wrote : Re: [Bug 1820513] Re: android-* packages not working well with OpenJDK 11

On 18.03.19 21:38, Andreas Schildbach wrote:
> Actually I don't find an openjdk-10-jdk[-headless] package in Bionic, so
> I'm not sure if I ever tested OpenJDK 10. Probably not.

they are called openjdk-11-* ;) Because we didn't want to keep an unsupported
openjdk-10 package in the LTS release.

Revision history for this message
Matthias Klose (doko) wrote :

On 18.03.19 21:16, Andreas Schildbach wrote:
> So yes, the Android builds work with OpenJDK 8, Gradle 3.4.1 under
> Ubuntu 18.04 LTS. On OpenJDK 11, Gradle 4.4.1 under Ubuntu 18.04 LTS-
> proposed the described issues appear. All issues I reported are
> perfectly reproducable.

ok, that means once the gradle in bionic-proposed works again with openjdk-8, we
should come back to your build using OpenJDK-8 and all of bionic-proposed.

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

Bug #1820389 has been fixed. It would be great if we could get some feedback on the android tools now. We would highly appreciate feedback on:

1. The packaged tools so we can understand what exactly is missing there
2. The upstream Android SDK so we can confirm that the regression is gone with Gradle 4.4.1 and OpenJDK-8 under Ubuntu (as it used to work with Gradle 3.4.1 and OpenJDK 8).

For item #1 it is critical that we get a list of the required steps to reproduce it.

Thank you!

Revision history for this message
Andreas Schildbach (schildbach) wrote :

Feedback on #2 is contained in https://bugs.launchpad.net/ubuntu/+source/gradle/+bug/1820389. As far as I can tell the blocker regressions are gone. However there is still the issue of the missing alternative dependency declaration: https://bugs.launchpad.net/ubuntu/+source/gradle/+bug/1797761

I cannot tell much about #1, but if someone defines a test procedure I'm happy to help testing. I'd really like to use an Ubuntu/Debian toolchain in future. However I think the libgradle-android-plugin-java package (Android Gradle plugin) is very outdated. I've opened https://bugs.launchpad.net/ubuntu/+source/android-platform-tools-base/+bug/1821073 about this.

Matthias Klose (doko)
Changed in android-platform-tools-base (Ubuntu):
status: Incomplete → In Progress
status: In Progress → Fix Released
Changed in android-platform-tools-base (Ubuntu Bionic):
status: New → Fix Committed
Changed in android-platform-tools-base (Ubuntu Cosmic):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.