Git Product home page Git Product logo

java.lang.NoSuchMethodError: No virtual method getAnnotatedSuperclass()Ljava/lang/reflect/AnnotatedType; in class Ljava/lang/Class; or its super classes (declaration of 'java.lang.Class' appears in /apex/com.android.art/javalib/core-oj.jar) about bt HOT 2 OPEN

md-rifatkhan avatar md-rifatkhan commented on May 27, 2024
java.lang.NoSuchMethodError: No virtual method getAnnotatedSuperclass()Ljava/lang/reflect/AnnotatedType; in class Ljava/lang/Class; or its super classes (declaration of 'java.lang.Class' appears in /apex/com.android.art/javalib/core-oj.jar)

from bt.

Comments (2)

CombustibleIce avatar CombustibleIce commented on May 27, 2024

java.lang.NoSuchMethodError: No virtual method getAnnotatedSuperclass()Ljava/lang/reflect/AnnotatedType; in class Ljava/lang/Class; or its super classes (declaration of 'java.lang.Class' appears in /apex/com.android.art/javalib/core-oj.jar)

have you solved it?

from bt.

pvishnyakov avatar pvishnyakov commented on May 27, 2024

This is because Class in ART doesn't have the methods required by MapBinder (Guice extension). In standard Java RT the methods are in place.
I have managed it to work in Android, need to do several things:

  1. Add Cling repository to the project Gradle repositories (allprojects):
        maven {
            url 'http://4thline.org/m2'
            allowInsecureProtocol = true
        }
  1. Create module's Gradle dependencies as follows - comment UPnP library, exclude original Guice, add Roboguice:
    implementation 'org.roboguice:roboguice:4.0.0'
    compileOnly 'org.roboguice:roboblender:4.0.0'
    implementation ('com.google.inject.extensions:guice-multibindings:4.0') {
        exclude module: 'guice'
    }
    implementation 'org.fourthline.cling:cling-core:2.1.2';
    implementation 'org.fourthline.cling:cling-support:2.1.2';
    implementation ('com.github.atomashpolskiy:bt-core:1.10') {exclude group: 'com.google.inject', module: 'guice'}
    implementation ('com.github.atomashpolskiy:bt-http-tracker-client:1.10') {exclude group: 'com.google.inject', module: 'guice'}
    implementation ('com.github.atomashpolskiy:bt-dht:1.10') {exclude group: 'com.google.inject', module: 'guice'}
    implementation ('com.github.atomashpolskiy:bt-bencoding:1.10') {exclude group: 'com.google.inject', module: 'guice'}
//    implementation ('com.github.atomashpolskiy:bt-upnp:1.10') {exclude group: 'com.google.inject', module: 'guice'}
  1. Download the source code of BT-UPnP, copy "bt" folder and all its contents to the module's src/main
  2. Modify "JettyAsyncUpnpServiceConfiguration.java" to make the class declaration like this:
public class JettyAsyncUpnpServiceConfiguration extends AndroidUpnpServiceConfiguration

Basically that's all, should start working.
But I have another problem now, only 2 peers are connected and only 3 pieces are downloaded while the same code works fine in desktop Java.

from bt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.