Android Studio使用另一个AAR文件和jar内部创建AAR

我正在使用另一个aar和jar文件依赖项创建AAR文件.我已成功创建.aar发布文件.

然后,我将新的AAR文件导入到示例项目中.该项目运行良好.当要访问aar和jar类时,它显示NoClassDefFound错误.

注意:首先我想知道,截至目前,另一个AAR中的AAR是否有可能.任何人都可以帮助我摆脱这个新事物的问题吗?

我也提到了这个链接Create an AAR with multiple AARs/JARs.它说transitive = true.但是,不明白,在哪里使用那个标志.在第三方使用Application或在AAR项目依赖项中创建AAR.

谢谢提前.

我的迷你项目Gradle文件

Mini Project,只转换为.AAR文件.那么,这个文件只会使用另一个NewProject

Mini Project Build.gradle文件

/*
This would be enabled for development purpose and to debug and check the same
*/

apply plugin: 'com.android.application'

/*
This would be enabled for exporting as aar file
apply plugin: 'com.android.library'
*/

//apply plugin: 'com.android.library'

android {

    compileSdkVersion 23
    buildToolsversion "23.0.2"

    dexOptions {
        javaMaxHeapSize "4g"
        preDexLibraries = false
    }
    defaultConfig {

        /*
        This application id would be used for development purpose and to debug and check the same.
        This would be commented when exporting as library
        */
        applicationId 'com.pss.pssplayer'
        minSdkVersion 18
        targetSdkVersion 23
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
    }

    aaptOptions {
        cruncherEnabled = false
    }

    buildTypes {

        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'

        }
    }

    productFlavors {
    }
}

dependencies {

    compile filetree(include: ['*.jar'],dir: 'libs')

    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:23.1.1'

    compile 'com.android.support:support-v4:23.1.1'

    compile files('libs/ksoap2-android-assembly-3.2.0-jar-with-dependencies.jar')

    compile files('libs/secure.jar')

    compile(project(':getSubProject')) {

        transitive = true

    }// this getSubProject also contains one classes jar
}

解决方法

使用 android-fat-aar gradle插件,它超级实用!

相关文章

这篇“android轻量级无侵入式管理数据库自动升级组件怎么实现...
今天小编给大家分享一下Android实现自定义圆形进度条的常用方...
这篇文章主要讲解了“Android如何解决字符对齐问题”,文中的...
这篇文章主要介绍“Android岛屿数量算法怎么使用”的相关知识...
本篇内容主要讲解“Android如何开发MQTT协议的模型及通信”,...
本文小编为大家详细介绍“Android数据压缩的方法是什么”,内...