Why can't I import `com.android.tools.build:builde...
# android
h
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
you can do this, probably IDE issue, did you tried to invalidate project cache?
h
I did. AS 3.4,
com.android.builder.core.DefaultProductFlavor
still note accesable
g
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
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
interesting
m
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.