PSA: Support for Java 7 in AAR is deprecated

673 views
Skip to first unread message

Sami Kalliomäki

unread,
Nov 9, 2017, 4:30:54 AM11/9/17
to discuss-webrtc
Hi,

We are removing support for Java 7 in AAR generation script in two weeks. This affects both our prebuilt libraries and `build_aar.py` script. To continue using the libraries, you should migrate your toolchain to support Java 8. Instructions for Android Studio can be found here.

Technical details:
Previously, we transformed Java 8 bytecode to Java 7 bytecode for the AAR. The issue with this is that clients need to manually include desugar runtime in their application to avoid crashes and some features such as static/default methods in interfaces cannot be supported this way. In the new approach we will ship Java 8 bytecode directly and the client toolchain is responsible for doing the transformation.

If you have any questions or concerns, feel free to express them in this thread.

Regards,
Sami Kalliomäki

Sami Kalliomäki

unread,
Nov 23, 2017, 4:47:44 AM11/23/17
to discuss-webrtc
FYI: This is happening today.

David

unread,
May 28, 2018, 8:56:41 AM5/28/18
to discuss-webrtc
Hello,

I try to create a xamarin solution with webrtc.

Since this modification , i couldn't user WebRtc.. The desugar process in xamarin doesn't work .. It is possible to make a switch to enable Java7 Bytecode Retrocompatibilty ? 

Sami Kalliomäki

unread,
May 28, 2018, 9:48:31 AM5/28/18
to discuss-webrtc
Unfortunately, this is infeasible due to technical limitations.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4a1a5ebe-0ccf-463e-bb7b-943fb852207a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nurdin David

unread,
May 28, 2018, 10:23:44 AM5/28/18
to discuss...@googlegroups.com
Damn,

So the only solution is to get a old version ?



----- Mail original -----
De: "Sami Kalliomäki" <sa...@webrtc.org>
À: "discuss-webrtc" <discuss...@googlegroups.com>
Envoyé: Lundi 28 Mai 2018 15:47:45
Objet: Re: [discuss-webrtc] Re: PSA: Support for Java 7 in AAR is deprecated
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAD-mH0Fhd-MRWkUiMRyJkL2EbvZ7KuLtsVz3fik0ofaOrYkovg%40mail.gmail.com .

Jozsef Vass

unread,
May 29, 2018, 10:27:19 AM5/29/18
to discuss...@googlegroups.com
We worked around the issue when upgrading to WebRTC-65:

Java 8 is needed for building WebRTC. Instead of a single libwebrtc.jar, the following files are generated (javap -verbose MyClass | grep "major"):

Name
Version
Notes
libwebrtc.jar52ThreadUtils and Logging classes
audio_device_java.interface.java52
audio_device_java.jar51
libjingle_peerconnection_java.interface.jar52
libjinlge_peerconnection_java.jar51
libjingle_peerconnection_metrics_default_java.interface.jar52Not used
libjingle_peerconnection_metrics_default_java.jar51Not used

Interface JARs are merely function declarations and have major version 52, while implementation JARs are desugared to version 51.

Discord app targets API level 16, which does not support Java 8. Fortunately, with desugaring, we can still support API level 16, please see https://developer.android.com/studio/write/java8-support.html - however, external libraries already need to be desugared. When building WebRTC for Android, we reverted back to using dist_jar template, without interface JAR and with desugaring. This generated a single Java 7 libwebrtc.jar (just as with WebRTC 59). However EglBase::create (static interface method) is unavailable in libwebrtc.jar. We added a simple helper class as workaround.


Jozsef

On Mon, May 28, 2018 at 7:23 AM, Nurdin David <duch...@free.fr> wrote:
Damn,

So the only solution is to get a old version ?



----- Mail original -----
De: "Sami Kalliomäki" <sa...@webrtc.org>
À: "discuss-webrtc" <discuss-webrtc@googlegroups.com>

Envoyé: Lundi 28 Mai 2018 15:47:45
Objet: Re: [discuss-webrtc] Re: PSA: Support for Java 7 in AAR is deprecated


Unfortunately, this is infeasible due to technical limitations.


On Mon, May 28, 2018 at 2:56 PM David < duch...@free.fr > wrote:



Hello,


I try to create a xamarin solution with webrtc.


Since this modification , i couldn't user WebRtc.. The desugar process in xamarin doesn't work .. It is possible to make a switch to enable Java7 Bytecode Retrocompatibilty ?





On Thursday, November 23, 2017 at 10:47:44 AM UTC+1, Sami Kalliomäki wrote:


FYI: This is happening today.


On Thu, Nov 9, 2017 at 10:29 AM, Sami Kalliomäki < sa...@webrtc.org > wrote:



Hi,


We are removing support for Java 7 in AAR generation script in two weeks. This affects both our prebuilt libraries and `build_aar.py` script. To continue using the libraries, you should migrate your toolchain to support Java 8. Instructions for Android Studio can be found here .


Technical details:
Previously, we transformed Java 8 bytecode to Java 7 bytecode for the AAR. The issue with this is that clients need to manually include desugar runtime in their application to avoid crashes and some features such as static/default methods in interfaces cannot be supported this way. In the new approach we will ship Java 8 bytecode directly and the client toolchain is responsible for doing the transformation.


If you have any questions or concerns, feel free to express them in this thread.


Regards,
Sami Kalliomäki


--

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


--

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

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/410266218.76272806.1527517414384.JavaMail.root%40spooler3-g27.priv.proxad.net.

Sami Kalliomäki

unread,
May 30, 2018, 4:54:31 AM5/30/18
to discuss-webrtc
There shouldn't be any workaround needed if you are developing a normal Android application in Android Studio. Our Android Studio project compiling AppRTCMobile against the AAR works without any workarounds.

À: "discuss-webrtc" <discuss...@googlegroups.com>

Envoyé: Lundi 28 Mai 2018 15:47:45
Objet: Re: [discuss-webrtc] Re: PSA: Support for Java 7 in AAR is deprecated


Unfortunately, this is infeasible due to technical limitations.


On Mon, May 28, 2018 at 2:56 PM David < duch...@free.fr > wrote:



Hello,


I try to create a xamarin solution with webrtc.


Since this modification , i couldn't user WebRtc.. The desugar process in xamarin doesn't work .. It is possible to make a switch to enable Java7 Bytecode Retrocompatibilty ?





On Thursday, November 23, 2017 at 10:47:44 AM UTC+1, Sami Kalliomäki wrote:


FYI: This is happening today.


On Thu, Nov 9, 2017 at 10:29 AM, Sami Kalliomäki < sa...@webrtc.org > wrote:



Hi,


We are removing support for Java 7 in AAR generation script in two weeks. This affects both our prebuilt libraries and `build_aar.py` script. To continue using the libraries, you should migrate your toolchain to support Java 8. Instructions for Android Studio can be found here .


Technical details:
Previously, we transformed Java 8 bytecode to Java 7 bytecode for the AAR. The issue with this is that clients need to manually include desugar runtime in their application to avoid crashes and some features such as static/default methods in interfaces cannot be supported this way. In the new approach we will ship Java 8 bytecode directly and the client toolchain is responsible for doing the transformation.


If you have any questions or concerns, feel free to express them in this thread.


Regards,
Sami Kalliomäki


--

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


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAD-mH0Fhd-MRWkUiMRyJkL2EbvZ7KuLtsVz3fik0ofaOrYkovg%40mail.gmail.com .
For more options, visit https://groups.google.com/d/optout .

--

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

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CACHtiy95jJiyHXi90qMnDJwSo0wFWPE60nSj0M5UPdZBUW_Qzg%40mail.gmail.com.

David

unread,
May 30, 2018, 5:00:17 AM5/30/18
to discuss-webrtc
Lol... your answer is a little funny ;)

But i don't work on "a normal Android application" , i work to make a cross plateform and cross device with Xamarin application !

I know that the AAR compile on Android studio, because it work with Gradle and Android Studio know to desugar the code.

Raj

unread,
May 31, 2018, 2:12:58 PM5/31/18
to discuss-webrtc
Where can I download below jar files?
À: "discuss-webrtc" <discuss...@googlegroups.com>

Envoyé: Lundi 28 Mai 2018 15:47:45
Objet: Re: [discuss-webrtc] Re: PSA: Support for Java 7 in AAR is deprecated


Unfortunately, this is infeasible due to technical limitations.


On Mon, May 28, 2018 at 2:56 PM David < duch...@free.fr > wrote:



Hello,


I try to create a xamarin solution with webrtc.


Since this modification , i couldn't user WebRtc.. The desugar process in xamarin doesn't work .. It is possible to make a switch to enable Java7 Bytecode Retrocompatibilty ?





On Thursday, November 23, 2017 at 10:47:44 AM UTC+1, Sami Kalliomäki wrote:


FYI: This is happening today.


On Thu, Nov 9, 2017 at 10:29 AM, Sami Kalliomäki < sa...@webrtc.org > wrote:



Hi,


We are removing support for Java 7 in AAR generation script in two weeks. This affects both our prebuilt libraries and `build_aar.py` script. To continue using the libraries, you should migrate your toolchain to support Java 8. Instructions for Android Studio can be found here .


Technical details:
Previously, we transformed Java 8 bytecode to Java 7 bytecode for the AAR. The issue with this is that clients need to manually include desugar runtime in their application to avoid crashes and some features such as static/default methods in interfaces cannot be supported this way. In the new approach we will ship Java 8 bytecode directly and the client toolchain is responsible for doing the transformation.


If you have any questions or concerns, feel free to express them in this thread.


Regards,
Sami Kalliomäki


--

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


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAD-mH0Fhd-MRWkUiMRyJkL2EbvZ7KuLtsVz3fik0ofaOrYkovg%40mail.gmail.com .
For more options, visit https://groups.google.com/d/optout .

--

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

David

unread,
Jun 1, 2018, 4:21:40 AM6/1/18
to discuss-webrtc
These file are on your filesystem when you compile webrtc 

Raj

unread,
Jun 1, 2018, 11:23:48 AM6/1/18
to discuss-webrtc
ok thanks! A direct download link will be helpful. Just like aar files https://bintray.com/google/webrtc/google-webrtc/1.0.23430#read

Jozsef Vass

unread,
Jun 1, 2018, 1:07:13 PM6/1/18
to discuss...@googlegroups.com
Unfortunately, we have quite a bit of modification to webrtc, so I cannot share our jar file. However, I put together a gist showing the changes that I made to get WebRTC 65 working with Java 7: https://gist.github.com/vassjozsef/848b7fe7c46b107d276b019f21b0fb04.

Jozsef

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/2c3b0cdc-5966-4fc9-b7d8-cea64f5ef02f%40googlegroups.com.

Hữu Nguyễn

unread,
Jan 20, 2019, 10:06:27 AM1/20/19
to discuss-webrtc
I have converted code from java 8 to java 7.
Reply all
Reply to author
Forward
0 new messages