'Do we need Jack to use Java 8 features to make a build using Android.mk?

I have an Android.mk file and I was trying to make a build for Android 8.1 where I was using RxJava but while building it, I was getting the error

Lambda coming from jar file need their interfaces on the classpath to be compiled

so, I searched a lot and found that

"ANDROID_COMPILE_WITH_JACK:=false" 

fixes the issue but I want to know how and why it is like that.



Solution 1:[1]

I found on https://source.android.com/setup/build/jack that Jack supports Java programming language 1.7 and lambda(in rxJava) is 1.8 feature so is it causing the problem? That is why I need to disable the compilation?

Solution 2:[2]

You can't read a file that you have opened it with wb mode. wb mode indicates that you want to write something into it.

import PIL.Image as Image
import io
mport os

def main():
    path = __file__ #name of file = file.py
    path = path.replace('file.py', '') # replace the name of file to get folder path
    your_path = path #path of imgs and python file
    files = os.listdir(your_path)
    keyword = "*.jpg"
    for file in files:
        if file.endswith(keyword):
            jpg_path = os.path.join(your_path, file)
            if os.path.isfile(jpg_path):
                pil_im = Image.open(jpg_path)
                b = io.BytesIO()
                pil_im.save(b, 'jpeg')
                im_bytes = b.getvalue()
                # This is a bytearray of your image. Do rest of your coding...                                                           
main()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Pooya Mohammadi Kazaj