does anyone having problem after update Android St...
# multiplatform
m
does anyone having problem after update Android Studio Arctic Fox Canary 5 (2020.3.1.5) ?
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
lateinit property variantName has not been initialized
j
Just clutching at straws here but did you also update gradle wrapper as well (should happen as part of update it prompts you for if you accept that)?
Though I get a different error here if that isn't updated
m
Android Studio Arctic Fox Canary 5 (2020.3.1.5) Android Gradle Plugin 7.0.0-alpha05 Gradle 6.8.1
j
I'm on 6.8 for some reason but probably shouldn't make too much difference
m
but, is it now working for you? after you update the gradle wrapper…
j
yeah, everything seems to be fine
updated likes of https://github.com/joreilly/BikeShare for example
(along with the other KMP repos I have)
m
I’ve just created a fresh new project and the error still occurring:
Copy code
19:43:55: Executing task 'build'...

Executing tasks: [build] in project /Users/[my_user]/MyApplication/app


FAILURE: Build failed with an exception.

* What went wrong:
lateinit property variantName has not been initialized
Android Studio Arctic Fox Canary 5 (2020.3.1.5) Android Gradle Plugin 7.0.0-alpha05 Gradle 6.8
1
s
Change your gradle plugin to 4.1.0
👎 1
🤷‍♂️ 1
d
@magnumrocha I have the same problem. @Sean Keane 4.1.0 won't support the latest Compose Alpha.
👍 1
@magnumrocha Running with
--stacktrace
shows that the error is coming from Android Lint. I tried to disable Lint, but it's still being queried, apparently during Gradle's setup of its build logging/analytics.
s
@darkmoon_uk I had a similar issue. This was the resolution. https://youtrack.jetbrains.com/issue/IDEA-252823 No mention of Compose in this thread though so it's worth a try.
m
the problem is Android Studio Arctic Fox Canary 5 (2020.3.1.5) only works with AGP 7.0.0-alpha05, we can’t downgrade AGP version
s
Have you a sample project I can check with?
Copy code
//ROOT GRADLE
ext.android_gradle = '7.0.0-alpha05'
//GRADLE WRAPPER PROPERTIES 
distributionUrl=<https://services.gradle.org/distributions/gradle-6.8-bin.zip>
This works for me. Just updated a test project. Zero issues.
m
a fresh new Android Project, created on Android Studio Arctic Fox Canary 5 (2020.3.1.5) :
s
2 sec and I'll check on my end.
m
the `gradle-wrapper.properties`:
Copy code
#Thu Jan 28 19:43:08 WET 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
s
No issues for me Executing tasks: [appassembleDebug] in project /Users/sean/AndroidStudioProjects/TestGradlePlugin
Task apppreBuild UP-TO-DATE
Task apppreDebugBuild UP-TO-DATE
Task appcompileDebugAidl NO-SOURCE
Task appcompileDebugRenderscript NO-SOURCE
Task appgenerateDebugBuildConfig
Task appgenerateDebugResValues
Task appgenerateDebugResources
Task appcheckDebugAarMetadata
Task appcreateDebugCompatibleScreenManifests
Task appextractDeepLinksDebug
Task appprocessDebugMainManifest
Task appprocessDebugManifest
Task appmergeDebugNativeDebugMetadata NO-SOURCE
Task appjavaPreCompileDebug
Task appmergeDebugShaders
Task appcompileDebugShaders NO-SOURCE
Task appgenerateDebugAssets UP-TO-DATE
Task appmergeDebugAssets
Task appcompressDebugAssets
Task appprocessDebugJavaRes NO-SOURCE
Task appmergeDebugResources
Task appcheckDebugDuplicateClasses
Task appdesugarDebugFileDependencies
Task appmergeDebugJniLibFolders
Task appmergeLibDexDebug
Task appmergeDebugNativeLibs NO-SOURCE
Task appstripDebugDebugSymbols NO-SOURCE
Task appvalidateSigningDebug
Task appwriteDebugAppMetadata
Task appwriteDebugSigningConfigVersions
Task appprocessDebugManifestForPackage
Task appprocessDebugResources
Task appmergeExtDexDebug
Task appcompileDebugKotlin
Task appcompileDebugJavaWithJavac
Task appcompileDebugSources
Task appdexBuilderDebug
Task appmergeProjectDexDebug
Task appmergeDebugJavaResource
Task apppackageDebug
Task appassembleDebug
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings BUILD SUCCESSFUL in 13s 28 actionable tasks: 28 executed Build Analyzer results available
@magnumrocha What did you select when creating the project? Blank activity or Compose Preview?
m
Blank Activity
s
Same on my end. It just built. Did you reset your cache.
m
yes, I did, but I will do again, 1 sec.
same problem.
s
Can you check all SDK build tools are also updated?
👌 1
m
is that your setup?
d
I previously deleted entire
.gradle
folder and got the same (bugged) result so keen to hear how this goes...
s
Android Studio Arctic Fox | 2020.3.1 Canary 5 Build #AI-203.6682.168.2031.7101492, built on January 25, 2021 Runtime version: 11.0.8+10-b944.6842174 x86_64 VM: OpenJDK 64-Bit Server VM by N/A macOS 10.15.7 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 24 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: com.mallowigi, com.vincentp.gruvbox-theme
Did you update, or clean install? (I updated)
m
I made the Update
s
Can you give me the build.gradle file?
Copy code
12:49:50: Executing task 'compileLintChecks'...

Executing tasks: [compileLintChecks] in project /Users/sean/StudioProjects/guineaGram/app


> Configure project :app
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (<https://goo.gle/kotlin-android-extensions-deprecation>) to start working with View Binding (<https://developer.android.com/topic/libraries/view-binding>) and the 'kotlin-parcelize' plugin.
WARNING: API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'VariantProperties.applicationId'.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see TBD.
To determine what is calling BaseVariant.getApplicationIdTextResource, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

> Task :app:compileLintChecks UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings>

BUILD SUCCESSFUL in 150ms
12:49:51: Task execution finished 'compileLintChecks'.
Ok! It's the Linter. Its not running for my build on a blank project but when I run it separately I get this
Copy code
lateinit property variantName has not been initialized

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
🙃 2
Lol! Now I'm in you're situ on all the gradle tasks
d
Yes
I saw from the stack trace that it has something to do with the linter
But trying to disable linting doesn't help
Further down the stack trace suggests it's not really the act of linting either
s
Here's how I fixed it. Go to "Build Variant" -> Change to release -> Build -> Change back to debug -> Build.
d
I get the linter error when building from command line though, so my question would be how is that UI operation affecting the underlying Gradle invocation
s
That only works for building the app and not running it on a device
Ok. Resolved on my side. • Close the project • Go to the folder where the file is saved • Delete .gradle • Delete .idea • Empty bin (Just incase) • Re-open project • Press Play.
👎 1
🤔 1
d
Umm... In summary does that mean that just clearing caches thoroughly fixed it?
s
Clearing the cache's for AS doesn't. Manually clearing the caches does. When you run the clean command it doesn't "Clean" everything. So a manual delete forces the .gradle and .idea to be re-created to the standard of the project. So I'm guessing its an issue with the template as my other existing projects didn't have this problem.
m
not working for me….
d
Back on laptop, about to give it a go... but in my previous attempts to fix this I had 'deep cleaned'
Deleting
.gradle
.idea
should be irrelevant to a command line build
and those are failing for me; I'm not building from the IDE.
m
I discover the problem in a project that I was working before the AS update, then I’ve create a new project just to check if it was config Issue on my previous project
running by the gradle command line , with the AS closed I get the same problem….
s
I just seen that my workspace.xml between my "new project" and the one I fixed is different.
d
The problem when seen here is not to do with the IDE as @magnumrocha says
It happens in command-line Gradle build.
m
sure, the Issue is on AGP 7.0.0-alpha05
s
I managed to get my second app that wasn't working - working.
d
Sean do you mean by when you selected the variant manually in the IDE?
s
Bottom left corner, where you have "Build Variant" change it
d
If so, it sounds like that caused the IDE to invoke Gradle with some flag to specify the variant.
I'm not building in the IDE.
s
Yep! And it seems by not declaring it in the CLI its having a hissy fit.
d
Hmm, so what's the flag to specify variant to the CLI 🤔
That would make for a workaround
s
assembleDebug
d
Yep understand it ordinarily takes this from component of the task name
I was trying to run
check
Ok, so maybe I can limit to the Gradle tasks that specify variant... to limp through.
s
It seems if the Variant name is specified with the assemble task it works. I can install and run the project. So I'm guessing the issue here is the build doesn't have its default for debug in the CLI tool.
d
But this is definitely looking like a serious bug in
alpha05
👌 1
s
If you want more variants you can just declare them in the .gradle file and re-import.
d
I'm kind of surprised something this major could get through the Gradle Plugin CI pipeline TBH, you'd think there would be a unit test for performing a variantless build on... anything.
s
Don't be fooled. Unit tests are only as good as the people who write them 😉
🙂 1
Hopefully this will see you guys through!
K 1
d
Thanks @Sean Keane! We're definitely in bat country with '`alpha11` and friends' - plenty of other bugs being reported as well.
...but I didn't pick this tech stack for an easy ride 😉
K 1
🎉 1
💪 1
💯 1
👍 3
m
thank you guys @darkmoon_uk @Sean Keane 👍
👍 2
i
I can confirm I'm getting the same issues with my KMM project. Fingers cross this gets resolved quickly 🤞
🤞 3
u
This has been fixed in AGP 7.0.0-alpha07 😃
🎉 4
d
@Umit AYDIN As of now, 'only' two releases away 😨 https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google It got recognised as a P1 in the Google Issue so they might bring it forward? Good thing we can work around it.
💯 3
m
I hope they release the
7.0.0-alpha06
and
7.0.0-alpha07
together….