Andriod Studio使用自编译的libvlc.aar获取rtsp视频流问题

由于项目需要,需要修改libvlc中的相关类,所以将libvlc中的classes.jar进行反编译并修改,修改后替换对应的jar,再将libvlc打包为aar包,导入到项目中使用,但却无法识别,想问问这样导入的方式是对的吗?以下是相关截图和文件:

  • 导入的aar位置:

    img

  • aar文件的目录(相比于官方依赖,只修改了classes.jar文件)

    img

  • 配置aar:
plugins {
    id 'com.android.application'
}

android {
    compileSdk 32
    defaultConfig {
        applicationId "com.example.myapplication"
        minSdk 23
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation files('libs/Java-WebSocket-1.4.0-with-dependencies.jar')
    implementation 'org.apache.commons:commons-lang3:3.7'
    implementation files('libs/json-simple-1.1.1.jar')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    
    // 使用本地编译好的aar
    implementation files('libs/libvlc-all-3.1.12.aar')
//
//    //  导入libvlc依赖
//    implementation 'org.videolan.android:libvlc-all:3.1.12'
}
  • 导入工具类直接报错(相当于直接无法识别了):

    img

你将无法识别的全部删掉,然后重构一下试试