Fixed
Status Update
Comments
xa...@android.com <xa...@android.com>
ka...@gmail.com <ka...@gmail.com> #2
Confirm the issue.
OS: Windows 8.1, Ubuntu
OS: Windows 8.1, Ubuntu
ma...@gmail.com <ma...@gmail.com> #3
Confirmed.
Version of Android Studio (available in the about box): 0.5.0
OS version: OpenSuse 13.1 x64
Java JRE/JDK version: 1.7.0_51
OpenJDK Runtime Environment (IcedTea 2.4.4) (suse-24.13.5-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
Version of Android Studio (available in the about box): 0.5.0
OS version: OpenSuse 13.1 x64
Java JRE/JDK version: 1.7.0_51
OpenJDK Runtime Environment (IcedTea 2.4.4) (suse-24.13.5-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
al...@google.com <al...@google.com> #4
I'm looking into this issue today.
ga...@gmail.com <ga...@gmail.com> #5
Just delete line resources.srcDirs = ['src']
It solved the problem for me
It solved the problem for me
lu...@gmail.com <lu...@gmail.com> #6
Version of Android Studio (available in the about box): 0.5.0
OS version: Gentoo x64
Java JRE/JDK version: 1.7.0_51-b13
Confirmed problem and solution in #5 reply too.
OS version: Gentoo x64
Java JRE/JDK version: 1.7.0_51-b13
Confirmed problem and solution in #5 reply too.
ma...@gmail.com <ma...@gmail.com> #7
@gabin Thx for the workaround. It's working for me.
al...@google.com <al...@google.com> #8
I found the problem!!!!
The issue is that 'src' is both Java source and Java resource folder. Studio first marks it as Java source (good thing) and .java files are seen as Java classes, and right after that, the same folder is marked as a resource one (I'm talking in IDEA terms). The fix is to make Studio do the opposite. Working on it.
The issue is that 'src' is both Java source and Java resource folder. Studio first marks it as Java source (good thing) and .java files are seen as Java classes, and right after that, the same folder is marked as a resource one (I'm talking in IDEA terms). The fix is to make Studio do the opposite. Working on it.
al...@google.com <al...@google.com> #9
Fix confirmed. It works.
What surprises me is that this is not new in 0.5.0. We had this bug in previous versions!
What surprises me is that this is not new in 0.5.0. We had this bug in previous versions!
al...@google.com <al...@google.com> #10
BTW, the issue with gradle file editor (marking "main" as warning) is a separate issue.
al...@google.com <al...@google.com> #11
ka...@gmail.com <ka...@gmail.com> #12
Great news, thanks.
Will be waiting for 0.5.1
Will be waiting for 0.5.1
e....@gmail.com <e....@gmail.com> #13
Confirmed. #5 work for me too
al...@google.com <al...@google.com> #14
Fix has been merged. Studio 0.5.1 will have this change.
[Deleted User] <[Deleted User]> #16
Any clue when an update will be pushed out?
xa...@android.com <xa...@android.com> #17
we release roughly weekly.
al...@google.com <al...@google.com> #18
We usually have weekly updates -> we expect 0.5.1 to be released next week. On the meantime, please use the workaround in #5. Sorry for the inconvenience.
[Deleted User] <[Deleted User]> #19
My build.gradle file doesn't have "resources.srcDirs" defined at all but I'm still getting this error.
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
}
}
al...@google.com <al...@google.com> #20
Daniel, what is the error that you are getting? Can you please share some more details?
BTW, I tried the snippet you provided with Studio (after fix applied) and it worked fine.
BTW, I tried the snippet you provided with Studio (after fix applied) and it worked fine.
[Deleted User] <[Deleted User]> #21
Hovering over sourceSets{main{}} shown above in Android Studio gives me tooltip error 'main' in 'build' cannot be applied to (groovy.lang.Closure<java.util.ArrayList>)'.
Builds are now yielding errors about xml files being invalid but compiling from the cli works perfect. This was all working perfect before 0.5.0
Builds are now yielding errors about xml files being invalid but compiling from the cli works perfect. This was all working perfect before 0.5.0
fa...@gmail.com <fa...@gmail.com> #22
I updated to 0.5.1 and still have the tooltip error.
## Here is my build.gradle file (Android library):
apply plugin: 'android-library'
android {
compileSdkVersion 14
buildToolsVersion "19.0.3"
buildTypes {
/*
Publish all variants (debug and release here) of the library so they are available to other project
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication
*/
publishNonDefault true
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = [
'src/main/java',
'src/main/deps/email/src',
'src/main/deps/jsr305/src'
]
}
}
}
## Android Studio tooltip displays on the main block
'main' in 'build' cannot be applied to '(groovy.lang.Closure<java.util.ArrayList>)'
This inspection reports assignments with incompatible types
## Here is my build.gradle file (Android library):
apply plugin: 'android-library'
android {
compileSdkVersion 14
buildToolsVersion "19.0.3"
buildTypes {
/*
Publish all variants (debug and release here) of the library so they are available to other project
*/
publishNonDefault true
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = [
'src/main/java',
'src/main/deps/email/src',
'src/main/deps/jsr305/src'
]
}
}
}
## Android Studio tooltip displays on the main block
'main' in 'build' cannot be applied to '(groovy.lang.Closure<java.util.ArrayList>)'
This inspection reports assignments with incompatible types
[Deleted User] <[Deleted User]> #23
I can build successfully on 0.5.1 but I still get the same error tooltip as #22
vs...@google.com <vs...@google.com> #24
The error tooltip can be ignored. See Issue 36949180 for more info.
na...@gmail.com <na...@gmail.com> #25
I have this bug on intellij 13.1.2 and and gradle for android 0.9.0
[Deleted User] <[Deleted User]> #26
I'm having this same issue on Android Studio 0.8.2 on Mac OSX X 10.9.4
la...@gmail.com <la...@gmail.com> #27
Also having this issue Android Studio 0.8.10, Mac OSX 10.9.4
al...@google.com <al...@google.com> #28
Lawrence, can you please attach a project that reproduces this issue? Thank you!
kz...@gmail.com <kz...@gmail.com> #29
Same here, Windows 7, Android Studio 0.8.10, I used Android Studio 'Create New Project' creator and selected 'Phone and Tablet' and 'Wear' with Minimum SDK set to 15.
fr...@gmail.com <fr...@gmail.com> #30
Same here, Archlinix, Android Studio 1.0.0 RC-2
va...@googlemail.com <va...@googlemail.com> #31
Same issue with AS 1.0.1
er...@gmail.com <er...@gmail.com> #32
Same issue Android Studio 1.0.1, Mac OSX 10.10.1
ro...@r11r.ca <ro...@r11r.ca> #33
Same issue in Android Studio 1.0.2 , Mac OS X. Trying to convert an older Android Studio project to Gradle using this configuration http://tools.android.com/tech-docs/new-build-system/migrating-from-intellij-projects
az...@azizi2u.com <az...@azizi2u.com> #34
i fix it by opening another gradle based project. and then open in new window the project that have gradle error "groovy lang closure". Then, the problem suddenly gone.
Description
Java JRE/JDK version: 1.7.0_45 x64
Android Studio version: 0.5.0
I have a project with a custom directory structure:
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
jniLibs.srcDirs = ['libs']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
Everything worked as expected with previous Android Studio version, but with version 0.5.0 I have following issues:
1. main tag in build.gradle is highlighted as warning with message "'main' in 'build' cannot be applied to '(groovy.lang.Closure<java.util.ArrayList>)'"
2. All java files are not recognized as real java files anymore - syntax highlight is broken, code is not validated
The interesting part is that gradle is still able to compile the project without any problems.
Everything works as expected if I remove sourceSets from the build.gradle and change project structure to the default one.