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

Dependency issues #4

Open
majgab8852 opened this issue Jun 12, 2019 · 1 comment
Open

Dependency issues #4

majgab8852 opened this issue Jun 12, 2019 · 1 comment

Comments

@majgab8852
Copy link

I added the plugin into my build.gradle file as I saw it here. Here is the complete build.gradle file:

plugins {
    id "io.github.manosbatsis.gradle.plugin.reflections" version "1.1"
}

apply plugin: 'java'

reflections {
    dependsOn classes
}
jar {
    dependsOn reflections
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.avaya.mobilevideo"
        minSdkVersion 24
        targetSdkVersion 26

        //jackOptions {
        //    enabled true
        //}
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
    }
}

dependencies {
    api 'com.android.support:support-v4:26.1.0'
    implementation 'org.reflections:reflections:0.9.11'
    implementation 'dom4j:dom4j:1.6.1'
    implementation files('libs/avaya-client-sdk-android-3.4.1.jar')
    implementation files('libs/android-logging-log4j-1.0.3.jar')
    implementation files('libs/log4j-1.2.17.jar')
}

The rest of the stuff was already part of the file (this is a sample project that was provided by vendor). When synchronizing, I got this error:

The 'java' plugin has been applied, but it is not compatible with the Android plugins.

When I remove the java plugin, I get another error:

Could not get unknown property 'classes' for task ':app:reflections' of type io.github.manosbatsis.gradle.plugin.reflections.ReflectionsMetadataEmbeddingTask.

How to proceed from here?

@manosbatsis
Copy link
Owner

I've never developed for android but i believe an android module cannot also be a java module. Assuming the plugin actually works with android classes, you will have to do the equivalent setup like bellow, only using *android" gradle tasks

// reflections plugin needs the compiled
// project classes, so either chain tasks
// with dependsOn as bellow or execute tasks explicitly
// when using the command line
reflections{
    dependsOn classes
}
jar{
    dependsOn reflections
}

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