1

I have an android app that works fine (build and apk installation) through androudstudio + gradle build. This app uses WebRTC library:

implementation("org.webrtc:google-webrtc:1.0.27771")

Now I want to change the build and do it through Android.mk inside AOSP, I have tried several options but all fails with the same error:

ERROR: YuvConverter.java:230-231: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: Camera1Session.java:306-307: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: Camera1Session.java:306-307: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: SurfaceTextureHelper.java:234-235: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: SurfaceTextureHelper.java:213-214: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: SurfaceTextureHelper.java:186-187: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: SurfaceTextureHelper.java:305-306: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: SurfaceTextureHelper.java:255-256: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: SurfaceTextureHelper.java:147-148: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.graphics.SurfaceTexture$OnFrameAvailableListener
ERROR: SurfaceTextureHelper.java:205-206: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
...

Trys:

  1. Add the same dependency that gradle downloads and use: google-webrtc-1.0.27771.aar and add it like all my others aar dependencies.
  2. Extract the jar and libjingle_peerconnection_so.so from the webrtc aar file and add it individually to the Android.mk

¿How can I use google webrtc inside Android.mk?

Update 1

I have tested several versions and found that: google-webrtc-1.0.20723.aar and less works fine but versions above no.

Problem seems to be related with lambda support in Android. I don't really know if I am missing any special flag to set up java lambda compilance in Android.mk.

I am using targetSdkVersion="27"and AOSP sdk version = 27 too.

Solution

After hours of google searching... I got the solution, or at least this solves my problem. Keep it here for future guys strugling with the same problem.

All you have to do is disable Jack in the AOSP build. I set the following line in my Android.mk app, at start.

LOCAL_PATH:= $(call my-dir)
ANDROID_COMPILE_WITH_JACK:=false
...

And now it works.

Additional info for Jack: https://source.android.com/setup/build/jack

dgcipp
  • 339
  • 3
  • 17

0 Answers0