jaredsburrows / gradle-spoon-plugin

Gradle plugin that provides a task to run Android instrumentation tests via Spoon.
https://jaredsburrows.github.io/gradle-spoon-plugin/
Apache License 2.0
127 stars 27 forks source link

cant exucute command "gradle spoon" with dagger #36

Closed Kadanza closed 6 years ago

Kadanza commented 6 years ago

when i try to exucute ./gradlew spoon i have many of error like below.

i use kotlin with dagger. mb this case to error.

e:/Users/developer/Desktop/projects/TaxiAndroid/app/build/tmp/kapt3/stubs/debug/com/nicecode/taxi/app/di/AppComponent.java:8: error: cannot find symbol public abstract interface AppComponent extends dagger.android.AndroidInjector { ^ symbol: class AndroidInjector location: package dagger.android

jaredsburrows commented 6 years ago

Can you post your build.gradle?

Kadanza commented 6 years ago

sure. this gradle without spoon plugin. i think the problem is in generated files by dagger. i use last android studio 3.2.

buildscript { ext.kotlin_version = '1.2.41' ext.supportLibraryVersion = '27.1.1' ext.googleApiVersion = '11.4.2' ext.daggerVer = '2.16'

repositories {
    google()
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.0-alpha14'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "io.realm:realm-gradle-plugin:4.3.3"
}

}

allprojects { repositories { google() jcenter() maven { url 'https://jitpack.io' }

}

}

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

apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'realm-android'

android {

if (project.hasProperty('devBuild')) {
    splits.density.enable = false
    aaptOptions.crunchedEnabled = false
}
compileOptions.incremental = false
compileSdkVersion 27

defaultConfig {
    applicationId "com.nicecode.taxi"
    minSdkVersion 21
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "com.nicecode.taxi.MyRunner"
    //multiDexEnabled true

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

    debug {

// minifyEnabled false // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // ext.enableCrashlytics = false // ext.alwaysUpdateBuildId = false } }

}

dependencies { compileOnly 'javax.annotation:jsr250-api:1.0'

// Design.
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:cardview-v7:21.+'

//material design
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'

//testing
testImplementation 'junit:junit:4.12'

testImplementation 'org.mockito:mockito-core:2.6.3'
androidTestImplementation 'org.mockito:mockito-android:2.6.3'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.1"
implementation "android.arch.lifecycle:livedata:1.1.1"
kapt "android.arch.lifecycle:compiler:1.1.1"
// Paging
implementation "android.arch.paging:runtime:1.0.0-beta1"
// Test helpers for LiveData
androidTestImplementation "android.arch.core:core-testing:1.1.1"

//kotlin support
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-android', version: '0.22.5'

//rx
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'

//rx permission
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'

//Retrofit
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
androidTestImplementation 'com.squareup.retrofit2:retrofit-mock:2.4.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'com.pixplicity.htmlcompat:library:1.1.0'

//dagger
implementation "com.google.dagger:dagger:$daggerVer"
implementation "com.google.dagger:dagger-android-support:$daggerVer"
implementation 'com.github.arranlomas.daggerviewmodelhelper:daggerviewmodelhelper:0.1.0'
androidTestImplementation 'com.github.fabioCollini:DaggerMock:0.8.4'

kapt "com.google.dagger:dagger-android-processor:$daggerVer"
kapt "com.google.dagger:dagger-compiler:$daggerVer"
androidTestImplementation "com.google.dagger:dagger-android-support:$daggerVer"
androidTestImplementation "com.google.dagger:dagger-android-support:$daggerVer"

//eventbus
implementation 'org.greenrobot:eventbus:3.1.1'

/** App libs */

//google maps
implementation "com.google.android.gms:play-services-maps:$googleApiVersion"
implementation "com.google.android.gms:play-services-places:$googleApiVersion"
implementation "com.google.android.gms:play-services-location:$googleApiVersion"
implementation 'com.google.maps.android:android-maps-utils:0.4+'

// implementation('com.google.api-client:google-api-client-android:1.23.0') { // exclude group: 'org.apache.httpcosddsfsdfmponents' // }

} kotlin { experimental { coroutines "enable" } }

jaredsburrows commented 6 years ago

@Kadanza Where is the com.jaredsburrows.spoon plugin applied? Also there is no spoon task.

jaredsburrows commented 6 years ago

Closing this as this plugin does not support gradlew spoon.