Fixed
Status Update
Comments
uc...@google.com <uc...@google.com>
ch...@gmail.com <ch...@gmail.com> #2
This is merged in to studio-master-dev
There are pending cherrypicks in studio-3.3-dev
platform/tools/analytics-library: studio-3.3-dev: Add deinitialize to UsageTracker.
platform/tools/base: studio-3.3-dev: Fix analytics deinitialization race.
platform/tools/base: studio-3.3-dev: Deinitialize analytics after each build.
platform/tools/base: studio-3.3-dev: Clean up ProcessProfileWriterFactory
There are pending cherrypicks in studio-3.3-dev
platform/tools/analytics-library: studio-3.3-dev: Add deinitialize to UsageTracker.
platform/tools/base: studio-3.3-dev: Fix analytics deinitialization race.
platform/tools/base: studio-3.3-dev: Deinitialize analytics after each build.
platform/tools/base: studio-3.3-dev: Clean up ProcessProfileWriterFactory
tn...@google.com <tn...@google.com>
di...@gmail.com <di...@gmail.com> #4
Submitted in 3.3-dev, need to cherry pick for 3.4
xa...@google.com <xa...@google.com> #5
Submitted in 3.3, 3.4 and master
di...@gmail.com <di...@gmail.com> #6
After upgrade to 3.3 I upgraded AGP to 3.3.0.
Then I noticed this bug and downgraded AGP to 3.2.1. Still being on 3.3. Bug was still there.
I didn't change any other plugin versions explicitly. I think kotlin gradle plugin was at 1.3.11 version at all times.
Gradle version was 4.10.3 for both 3.2 and 3.3.
Then downgraded to AS 3.2.1, AGP 3.2.1, bug is gone.
Then I noticed this bug and downgraded AGP to 3.2.1. Still being on 3.3. Bug was still there.
I didn't change any other plugin versions explicitly. I think kotlin gradle plugin was at 1.3.11 version at all times.
Gradle version was 4.10.3 for both 3.2 and 3.3.
Then downgraded to AS 3.2.1, AGP 3.2.1, bug is gone.
ga...@google.com <ga...@google.com> #7
Kotlin Gradle plugin registers only Java files that kapt generates, and generated Kotlin files are not registered.
However, there seems to be some IDE logic that changed, because Android Studio 3.2.1 marks generated .kt files as sources with AGP 3.2.1, AGP 3.3.0, AGP 3.5.0-alpha01. Using Android Studio 3.3, and 3.5 with any AGP does not.
Before adding generated Kotlin files to our model, I'd like to identify what has changed in the IDE. Bradley, are you familiar with this area?
However, there seems to be some IDE logic that changed, because Android Studio 3.2.1 marks generated .kt files as sources with AGP 3.2.1, AGP 3.3.0, AGP 3.5.0-alpha01. Using Android Studio 3.3, and 3.5 with any AGP does not.
Before adding generated Kotlin files to our model, I'd like to identify what has changed in the IDE. Bradley, are you familiar with this area?
sm...@google.com <sm...@google.com>
sm...@google.com <sm...@google.com> #8
This issue should be fixed in 3.3.1.
Thanks for the report, feel free to reopen this issue if the issue persists.
Thanks for the report, feel free to reopen this issue if the issue persists.
lb...@gmail.com <lb...@gmail.com> #9
@8 I have version 3.5 Canary 1, and I still saw this (and reported about it).
How could 3.3.1 fix this?
How could 3.3.1 fix this?
sm...@google.com <sm...@google.com> #10
Stable/Beta/Canary are separate channels and 3.3.1 is a version that fixes major issues in 3.3.
For the other channels it should be in the next released build:
Stable - 3.3.1 in the stable channel.
Beta - 3.4 Beta 3.
Canary - 3.5 Canary 3.
For the other channels it should be in the next released build:
Stable - 3.3.1 in the stable channel.
Beta - 3.4 Beta 3.
Canary - 3.5 Canary 3.
lb...@gmail.com <lb...@gmail.com> #11
@10 I see. Thank you.
di...@gmail.com <di...@gmail.com> #12
By the way, did you test this fix against newly released Kotlin 1.3.20?
While being on older AS 3.2.1 simply switching kotlin to 1.3.20 causes this bug to reproduce and going back to 1.3.11 makes it disappear.
While being on older AS 3.2.1 simply switching kotlin to 1.3.20 causes this bug to reproduce and going back to 1.3.11 makes it disappear.
sm...@google.com <sm...@google.com> #13
Just tested with 1.3.20 and it seems to work fine.
There was a change to the Kotlin IDEA plugin that stopped it from registering the folders with the IDE models. I'm guessing 1.3.11 was before this change. I've moved this logic to the Android IDEA Plugin.
There was a change to the Kotlin IDEA plugin that stopped it from registering the folders with the IDE models. I'm guessing 1.3.11 was before this change. I've moved this logic to the Android IDEA Plugin.
di...@gmail.com <di...@gmail.com> #14
Great to know, thanks! Now waiting for 3.3.1 release :)
ch...@gmail.com <ch...@gmail.com> #15
Can anyone verify if this fix also applies to generated java code or is this a fix specific to the kotlin plugin?
To be more specific about my problem (in case its different than what was fixed):
I have a project that has a non-android java library (apply plugin: 'java-library') and is generating classes using the @AutoFactory annotation.
The classes are generated but not seen by AS 3.3 in any module (including the module that generates the class).
However, if i have an android library (apply plugin: 'com.android.library') the classes are generated AND are seen by AS 3.3
I have an example project setup to show what is happening
https://github.com/dymmeh/AS-3.3-Java-Code-Generation-Test
in MainActivity I'm trying to use my generated factory class "TestStringProviderFactory" which comes from the java only library, but AS does not recognize that class.
"TestAndroidStringProviderFactory" is from the android library and works fine.
I'm able to build and install the working apk
To be more specific about my problem (in case its different than what was fixed):
I have a project that has a non-android java library (apply plugin: 'java-library') and is generating classes using the @AutoFactory annotation.
The classes are generated but not seen by AS 3.3 in any module (including the module that generates the class).
However, if i have an android library (apply plugin: 'com.android.library') the classes are generated AND are seen by AS 3.3
I have an example project setup to show what is happening
in MainActivity I'm trying to use my generated factory class "TestStringProviderFactory" which comes from the java only library, but AS does not recognize that class.
"TestAndroidStringProviderFactory" is from the android library and works fine.
I'm able to build and install the working apk
sm...@google.com <sm...@google.com> #16
This fix for this only effected Android modules, non-android modules still do not work.
Seehttps://issuetracker.google.com/123501806 for updates on this.
See
lb...@gmail.com <lb...@gmail.com> #17
@16 The fix is available, or in the future release?
sm...@google.com <sm...@google.com> #18
The fix is not available yet unfortunately, there was an issue in Gradle and Idea with have been fixed recently however there appears to be another problem with how the IDEA Android Plugin handles non-android modules which meant that we get the fix that was commited to IDEA. There is still some work on our side to get this fixed.
lb...@gmail.com <lb...@gmail.com> #19
@18 ok thanks.
di...@gmail.com <di...@gmail.com> #20
I also noticed that "kaptTest" suffers from the same bug: If I use an annotation processor to generate something to use in unit tests it won't be seen by IDE.
For now I've applied the workaround by manually adding "build/generated/source/kaptKotlin/debugUnitTest" to "test.java.srcDirs".
I wonder if I should report a separate issue for this?
For now I've applied the workaround by manually adding "build/generated/source/kaptKotlin/debugUnitTest" to "test.java.srcDirs".
I wonder if I should report a separate issue for this?
Description
Build #AI-182.5107.16.33.5199772, built on December 25, 2018
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.20.1-arch1-1-ARCH
AGP version: 3.3.0 (same with 3.2.1)
Steps to Reproduce:
1. Create a project which uses annotation processor which generates files in kotlin. Example project attached.
2. Build the project from attached file. Observe build is successful
3. Open MyClass.kt
4. Classes inside `build/generated/source/kaptKotlin` are no longer visible in IDE and highlighted in RED
5. All this happens after successful compilation, so this is mismatch between IDE and gradle
6. This is a regression, this used to work in Android Studio 3.2.