0

I'm on ubuntu 16 android studio 2.3.3, device tablet 5.1. In my app I have these grandle file ....

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.example.bmeccoffice.remotehelp"
        minSdkVersion 22
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        jackOptions {
            enabled true
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
        incremental false
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support:design:26.+'
    compile 'org.webrtc:google-webrtc:1.0.21217'
    testCompile 'junit:junit:4.12'
}

I use an 5.1 device (tablet) and try to compile my symple app (actually only bottom navigation activity layout ... empty ... and nothing else) but I have a long list of 26 error during the Debug ....

Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.graphics.SurfaceTexture$OnFrameAvailableListener
Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.RunnableError:Static method (these error 12 times)
org.webrtc.EglBase create() not supported in Android API level less than 24
Error:Static method org.webrtc.EglBase create(org.webrtc.EglBase$Context sharedContext, int[] configAttributes) not supported in Android API level less than 24
Error:Static method org.webrtc.EglBase create(org.webrtc.EglBase$Context sharedContext) not supported in Android API level less than 24
Error:Static method org.webrtc.EglBase createEgl10(int[] configAttributes) not supported in Android API level less than 24
Error:Static method org.webrtc.EglBase createEgl10(javax.microedition.khronos.egl.EGLContext sharedContext, int[] configAttributes) not supported in Android API level less than 24
Error:Static method org.webrtc.EglBase createEgl14(android.opengl.EGLContext sharedContext, int[] configAttributes) not supported in Android API level less than 24
Error:Static method org.webrtc.EglBase createEgl14(int[] configAttributes) not supported in Android API level less than 24
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception

I've just modified it (before support was for 1_7 version) .... but I have these error .... if return to old version with VERSION_1_7 && jackOptions == false ... obtain these 3 error:

Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java    8 or above.
If you are using the 'java' gradle plugin in a library submodule add 
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
Error:1 error; aborting
    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:  java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex '/home/office/.android/build-cache/b4dd2b467a0ed596ad0e2a137856a6897964c81c/output/jars/classes.jar'
    to '/home/office/AndroidStudioProjects/RemoteHelp2/app/build/intermediates /transforms/dex/debug/folders/1000/10 /classes_5110517f2feea04a1d9834af1ccaded1b5e9f0d5'

I have a module ... an external library .. but without dependancy ...

We need to use webrtc API.

some suggest how to solve these error?

EDIT:

remove the module ... nothing change ... same error.

jww
  • 97,681
  • 90
  • 411
  • 885
  • after update android studio to 3.0.1, install sudo apt-get install lib64stdc++6 https://stackoverflow.com/a/39687061/8067435 – theman whosoldtheworld Jan 12 '18 at 15:22
  • Rather than edit the question to add the solution, post it as answer! [Answering your own question is not forbidden](https://meta.stackoverflow.com/a/250208/4733879) (there is even an option to answer the question directly at the [Ask a Question](https://stackoverflow.com/questions/ask) page) – Filnor Jan 12 '18 at 15:31
  • @themanwhosoldtheworld - Please place answers in the Answer block. It is OK to answer your own question. – jww Jan 12 '18 at 18:02
  • @jww where is answer block? thanks – theman whosoldtheworld Jan 13 '18 at 19:05

1 Answers1

1

previously I have posted the wrong solution .... change Gl performances (hardware or software) is not part of solutions.

the real solutions is:

sudo apt-get install lib64stdc++6 

after these take advantage from new features I update Android Studio to version 3.0.1.

So the correct part of app->grandle.build is these:

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
    applicationId "com.example.bmeccoffice.remotehelp"
    minSdkVersion 22
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    jackOptions {
        enabled true
    }
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    incremental false
}
}

thats all.

bkt

  • If this answer provides a solution, you can mark it as the accepted answer, even if it's your own. – jamix Jan 22 '18 at 08:20