JingYeoh / FragmentRigger

:boom:A powerful library powered by AOP to manage Fragments.(一个基于AOP设计的Fragment管理框架)
MIT License
2.26k stars 266 forks source link

编译报错 transformClassesWithDexBuilderForDebug #9

Closed SageLu closed 6 years ago

SageLu commented 6 years ago

Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.

Unexpected scopes found in folder 'D:\androidProjict\FragmentRigger-master\app\build\intermediates\transforms\AspectTransform\debug'. Required: PROJECT, SUB_PROJECTS, EXTERNAL_LIBRARIES. Found: EXTERNAL_LIBRARIES, PROJECT, PROJECT_LOCAL_DEPS, SUB_PROJECTS, SUB_PROJECTS_LOCAL_DEPS

添加了 multiDexEnabled true ,还是不行 defaultConfig { .......... multiDexEnabled true }

JingYeoh commented 6 years ago

@SageLu 这属于AsPectJ依赖时候产生的错误,请把你根目录和module下的gradle配置发出来

cuncunniu commented 6 years ago

close your install run

SageLu commented 6 years ago

麻烦看一下~_~ @JustKiddingBaby

根目录gradle:

`apply from: "config.gradle"

buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1'

    classpath 'com.novoda:bintray-release:0.5.0'

    classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:1.0.10'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { jcenter() maven { url 'https://jitpack.io' } google() } tasks.withType(Javadoc) { options.addStringOption('Xdoclint:none', '-quiet') options.addStringOption('encoding', 'UTF-8') } }

task clean(type: Delete) { delete rootProject.buildDir } `

module 的gradle:

`apply plugin: 'com.android.application' apply plugin: 'android-aspectjx'

android {

compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
    applicationId rootProject.ext.app.applicationId
    minSdkVersion rootProject.ext.android.minSdkVersion
    targetSdkVersion rootProject.ext.android.targetSdkVersion
    versionCode rootProject.ext.app.versionCode
    versionName rootProject.ext.app.versionName
    multiDexEnabled true
}

compileOptions {
    sourceCompatibility rootProject.ext.android.sourceCompatibilityVersion
    targetCompatibility rootProject.ext.android.targetCompatibilityVersion
}

signingConfigs {
    myConfig {
        storeFile file(rootProject.ext.store.storeKey)
        storePassword rootProject.ext.store.storePassword
        keyAlias rootProject.ext.store.keyAlias
        keyPassword rootProject.ext.store.keyPassword
        v2SigningEnabled false
    }
}

buildTypes {
    release {
        minifyEnabled false
        //是否清理无用资源
        shrinkResources false
        //是否启用zipAlign压缩
        zipAlignEnabled false
        signingConfig signingConfigs.myConfig
        versionNameSuffix rootProject.ext.app.versionNameSuffix
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        signingConfig signingConfigs.myConfig
        versionNameSuffix rootProject.ext.app.versionNameSuffix
    }
}

lintOptions {
    abortOnError false
}

// buildToolsVersion '26.0.2' }

dependencies { compile rootProject.ext.dependencies.design compile project(':fragment-rigger') compile 'com.squareup.picasso:picasso:2.5.2' } `

SageLu commented 6 years ago

default @cuncunniu unchecked ,but still useless?

JingYeoh commented 6 years ago

@SageLu 请升级AspectJ的插件版本试试。 在根目录的build.gradle中升级插件版本如下:

classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:1.1.0'