https://kotlinlang.org logo
#android
Title
# android
h

hmole

04/23/2019, 7:28 AM
Why can't I import
com.android.tools.build:builder
artifact into my
buildSrc
to be able to configure AGP from kotlin code? Sources compile fine, but the code that references it is all red in IDE. Anyone faced simular issue?
g

gildor

04/23/2019, 7:40 AM
you can do this, probably IDE issue, did you tried to invalidate project cache?
h

hmole

04/23/2019, 8:08 AM
I did. AS 3.4,
com.android.builder.core.DefaultProductFlavor
still note accesable
g

gildor

04/23/2019, 8:11 AM
Maybe you could try to share sample project
Just realized that you have strange dependency id. You probably need
com.android.tools.build:gradle
not
com.android.tools.build:builder
h

hmole

04/23/2019, 8:15 AM
You misunderstood. AGP is composed of multiple artifacts. The ones that expose mutable domain objects(like flavor, buildType, etc) ar in
com.android.tools.build:builder
jar. But IDE doesn't recognizes it
g

gildor

04/23/2019, 8:56 AM
interesting
m

Melih Aksoy

04/23/2019, 1:45 PM
https://issuetracker.google.com/issues/123032843 There’s a problem with
buildSrc
in Android Studio, afaik it’s fixed in 3.5 Canary 12. It may be causing the issue.
2 Views