简体   繁体   中英

Android - gradle build for project with 2 source folders fails

There is open source project https://github.com/PaulVI/freecol-android that I want to add gradle build. It however fails in Gradle 1.12 (and Android Studio 0.8.2) while Eclipse ADT shows it is OK.

Error message example:

E:\Android\freecol-android\src\net\sf\freecol\client\FreeColClient.java
Error: (31, 46) Error: package does not exist org.freecolandroid.repackaged.java.awt

The packages of course do exist.

gradle.build has

 sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['j2se-src','src']

to define j2se-src and src as source folders.

Android Studio recognizes 2 source folders, but of course shows the same gradle errors.

How to configure Gradle build for project with 2 source folders?

Closing as silly overlooked java and resource in gradle.build

Should be as

        java.srcDirs = ['j2se-src','src']
        resources.srcDirs = ['src']

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM