Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue importing library #1717

Open
EQEngineering opened this issue Feb 12, 2025 · 8 comments
Open

Issue importing library #1717

EQEngineering opened this issue Feb 12, 2025 · 8 comments

Comments

@EQEngineering
Copy link

Hello.
I'm developing a CivTAK plugin and i'm trying to add the library just as it is described in the README.md. My dependencies are the following:

dependencies {

    implementation fileTree(dir: 'libs', include: '*.jar')
    // Recyclerview version depends on some androidx libraries which
    // are supplied by core, so they should be excluded.  Otherwise
    // bad things happen in the release builds after proguarding
    implementation ('androidx.recyclerview:recyclerview:1.1.0') {
        exclude module: 'collection'
        // this is an example of a local exclude since androidx.core is supplied by core atak
        exclude module: 'core'
        exclude module: 'lifecycle'
        exclude module: 'core-common'
        exclude module: 'collection'
        exclude module: 'customview'
    }

    implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
    implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'

    implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
    implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'

    implementation 'mil.nga:mgrs:2.1.3'

    implementation 'com.github.pedroSG94.RootEncoder:library:2.5.5'
    implementation 'com.github.pedroSG94.RootEncoder:extra-sources:2.5.5'    
}

Build correctly but when running i get the following error:

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.google.guava:guava:33.3.1-android.

Does anyone know how to solve this?

Thank you in advance

@pedroSG94
Copy link
Owner

pedroSG94 commented Feb 12, 2025

Hello,

This seem a problem related with a dependency of exoplayer. It is used to create a media file extractor. If you don't need extra-sources dependency you can remove it.
If you need it you should exclude exoplayer or guava the same way you do in recyclerview.

Also, check that you have google and mavenCentral repositories, not only jitpack

@EQEngineering
Copy link
Author

EQEngineering commented Feb 12, 2025

Ok thank you, i'll try it as soon as possible. Why is it a problem related to the dependency of exoplayer? It refers to guava... Just to make sure i understand this. As soon as i try what you have told me i'll let you know if it worked! Thank you!

@pedroSG94
Copy link
Owner

Hello,

It is a dependency of exoplayer because exoplayer use that versión of guava. You can check all dependencies in your project as a tree using app:dependencies command in gradle console inside android studio

Image

Usng that command you will see a dependency tree in the console log. You can look for that dependency and you can see that exoplayer use it.
So the solution is fix exoplayer dependency or remove it

@EQEngineering
Copy link
Author

EQEngineering commented Feb 14, 2025

I've tried this

dependencies {

    implementation fileTree(dir: 'libs', include: '*.jar')
    // Recyclerview version depends on some androidx libraries which
    // are supplied by core, so they should be excluded.  Otherwise
    // bad things happen in the release builds after proguarding
    implementation ('androidx.recyclerview:recyclerview:1.1.0') {
        exclude module: 'collection'
        // this is an example of a local exclude since androidx.core is supplied by core atak
        exclude module: 'core'
        exclude module: 'lifecycle'
        exclude module: 'core-common'
        exclude module: 'collection'
        exclude module: 'customview'
    }

    implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
    implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'

    implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
    implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'

    implementation 'mil.nga:mgrs:2.1.3'

    implementation('com.github.pedroSG94.RootEncoder:library:2.5.5'){
        exclude module: 'guava'
    }
    implementation('com.github.pedroSG94.RootEncoder:extra-sources:2.5.5'){
        exclude module: 'guava'
    }
}

But now i get the following error:

java.lang.IllegalArgumentException: Unsupported class file major version 61

Image

How can i solve this? I'm pretty lost with this one... I'm just trying to get the video feed from a USB Camera using your library

@pedroSG94
Copy link
Owner

Hello,

Are you using java 17?
That error is related with the java version. Try to use java 17 in the project config and the IDE

@EQEngineering
Copy link
Author

Hello

Yes. I've set it in Android Studio and still same error...

@pedroSG94
Copy link
Owner

Hello,

Check that you have something similar to this:

Image

Inside you build.gradle (module app). Like I'm doing here:
https://github.com/pedroSG94/RootEncoder/blob/master/app/build.gradle.kts#L24
Also, check JDK version inside settings > build, execution, development > build tools > gradle > gradle JDK (check that you are using JDK 17. Similar to this image:

Image

If all the problem persist. remove extra-source dependency and copy this class:
https://github.com/pedroSG94/RootEncoder/blob/master/extra-sources/src/main/java/com/pedro/extrasources/CameraUvcSource.kt
Add this dependency to your project:
https://github.com/pedroSG94/RootEncoder/blob/master/gradle/libs.versions.toml#L40

@EQEngineering
Copy link
Author

Ok thank you. I'll try to configure this as soon as i can and i'll let you know if it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants