https://kotlinlang.org logo
h

Hanzhen

06/12/2020, 2:59 PM
Hi, I tried to import support/ui in AS but got ‘Basedir support/ui/annotation does not exist’ error. I followed the steps in README.md in the same folder. AS version is 4.1 Canary 10.
a

Adam Powell

06/12/2020, 4:02 PM
run
./gradlew studio
and it will give you a correctly configured android studio installation of the expected version
(from the
ui/
subdirectory)
you should not need to import the project explicitly
h

Hanzhen

06/12/2020, 4:16 PM
I tried this as well, but had error: ‘Android Studio*.app not found’. After copied studio folder from ‘support’, I can open AS from the command. But still had the same error.
Seems includeProject in settings.gradle can not set projectDir correctly.
My gradle version is 6.5
a

Adam Powell

06/12/2020, 4:46 PM
what OS and version are you running on your development machine?
h

Hanzhen

06/12/2020, 5:23 PM
macOS Mojave 10.14.6
I figure out what was going on. I exited
./gradlew studio
before it was finished, so
studio
task thought AS was updated but in fact it didn’t. I reported the issue and pushed a fix: https://android-review.googlesource.com/c/platform/frameworks/support/+/1333982
Yet I still couldn’t start the studio:
I update AS to 4.1.0.10, now it can be started.
Do you have the same issue? Should I report it?
But project can not sync because of this error:
Basedir /*/androidx-master-dev/frameworks/support/ui/annotation does not exist
.
I think it’s because how we include the project, for instance:
includeProject(":annotation:annotation-sampled", "../annotation/annotation-sampled")
, it will not only include ``annotationannotation-sampled``, but also parent project ``:annotation``, and for the parent project, it will try to search dir
ui/annotation
which is
rootProjectDir/projectPath
. In this case, apparently we don’t have
support/ui/annotation
but
support/annotation
.
Solution would be include parent project manually in
settings.gradle
.
After fixed above issues, AS asked me to upgrade
Android Gradle Plugin
to
4.1.0-alpha10
.
@Adam Powell I still can not make it.
a

Adam Powell

06/15/2020, 5:09 PM
there is often a warning in the project about the duplicate project roots but I've never seen it refuse to proceed from there. Is that warning masking another error somewhere?
h

Hanzhen

06/16/2020, 5:45 PM
@Adam Powell I deleted caches of Android Studio, everything is fine now.
👍 1