Wire: Android Studio marks generated classes as unresolved

Created on 5 Aug 2019  路  2Comments  路  Source: square/wire

Gradle

Most helpful comment

I haven't looked through the source, but I suspect the Gradle plugin is not adding those sources to the classpath.

I ran into this too and hacked around it by adding:

sourceSets {
    main.java.srcDirs += "$buildDir/generated/src/main/java"
}

All 2 comments

I haven't looked through the source, but I suspect the Gradle plugin is not adding those sources to the classpath.

I ran into this too and hacked around it by adding:

sourceSets {
    main.java.srcDirs += "$buildDir/generated/src/main/java"
}

@MorrisonCole what would be equivalent code for kotlin dsl?

EDIT: Following works

  sourceSets {
    getByName("main") {
      this.java.srcDir("$buildDir/generated/source/")
    }
  }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gilb007 picture Gilb007  路  10Comments

alecmuffett picture alecmuffett  路  12Comments

bwalter picture bwalter  路  13Comments

mgenov picture mgenov  路  11Comments

Egorand picture Egorand  路  13Comments