Status Update
Comments
ja...@gmail.com <ja...@gmail.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
ja...@gmail.com <ja...@gmail.com> #3
it's a known issue of the databinding annotation processor, we working on fixing this in the 3.3 release time frame
co...@gmail.com <co...@gmail.com> #4
Thanks! It's just a little bit sad, that it will not be in 3.2, especially when fix which I saw on existing project is relatively small, like
https://github.com/evernote/android-state/commit/0072478291e2735223d6c14cb79a6b26524ec075
ja...@gmail.com <ja...@gmail.com> #5
Is it still planned for 3.3?
vs...@google.com <vs...@google.com>
an...@google.com <an...@google.com> #6
Yes, we are actively working on this issue.
(Making data binding incremental is not a straightforward fix because data binding changes resource files, and whenever a resource changes, Gradle needs to do a full recompile. For more info, please seehttps://github.com/gradle/gradle/issues/4701 .)
(Making data binding incremental is not a straightforward fix because data binding changes resource files, and whenever a resource changes, Gradle needs to do a full recompile. For more info, please see
an...@google.com <an...@google.com> #7
Starting with AGP 3.3.0-alpha10, JavaCompile will be incremental if you set the new experimental flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file. (If your project is using Kapt, then you don't even need to set the flag.) See Issue 115774858 .
Please try out this feature and let us know your performance gains. (Also let us know whether you are using Kapt or not.) Thanks!
Please try out this feature and let us know your performance gains. (Also let us know whether you are using Kapt or not.) Thanks!
co...@gmail.com <co...@gmail.com> #8
I tried it on my project, where Kotlin is used and also Databinding.
I was testing it by the alpha 11 version.
It warns me that data binding annotation processor does not support incremental compilation and I should consider using android.enableSeparateAnnotationProcessing=true
But it doesn't bring any speed improvement. I tried several times just change one line of code inside one method and re-run the app and it takes exactly the same time as with build plugin 3.2, maybe few seconds wors.
It takes a very long time to decompress data from build cache (something like 20s) and 3.2 whole compilation takes something like 30s.
So I don't understand what exactly was changed so far? Just android.enableSeparateAnnotationProcessing=true as kind of workaround how to use incremental compilation also in the situation I'm using annotation processor without direct support for it?
Probably I need to wait for incremental compilation support of Data Binding directly.
I was testing it by the alpha 11 version.
It warns me that data binding annotation processor does not support incremental compilation and I should consider using android.enableSeparateAnnotationProcessing=true
But it doesn't bring any speed improvement. I tried several times just change one line of code inside one method and re-run the app and it takes exactly the same time as with build plugin 3.2, maybe few seconds wors.
It takes a very long time to decompress data from build cache (something like 20s) and 3.2 whole compilation takes something like 30s.
So I don't understand what exactly was changed so far? Just android.enableSeparateAnnotationProcessing=true as kind of workaround how to use incremental compilation also in the situation I'm using annotation processor without direct support for it?
Probably I need to wait for incremental compilation support of Data Binding directly.
ja...@gmail.com <ja...@gmail.com> #9
Thank you for the feedback.
I assume that you are using Kotlin but not Kapt (if you were using Kapt, then the warning wouldn't show up). After you enable the flag, you should be able to see the Java compile task (:module:compile[Variant]JavaWithJavac) being incremental. For a full description of the feature, please see comment #4 of Issue 115774858 .
However, from what you said, it looks like the Java compile task is still non-incremental, so I'd like to find out why.
Could you run a build from the command line with --info after a one-line change and attach the console's contents here?
I assume that you are using Kotlin but not Kapt (if you were using Kapt, then the warning wouldn't show up). After you enable the flag, you should be able to see the Java compile task (:module:compile[Variant]JavaWithJavac) being incremental. For a full description of the feature, please see
However, from what you said, it looks like the Java compile task is still non-incremental, so I'd like to find out why.
Could you run a build from the command line with --info after a one-line change and attach the console's contents here?
an...@google.com <an...@google.com> #10
Yes I forgot about that, am still using annotationProcessor instead of kapt for the historical reason I will try to change it.
And kapt does not require support of annotation processor itself like it is necessary for Java only projects?
compile task looks incremental, but it doing something with cache very long time
Do you want the log with kapt already or still with annotationProcessor?
And kapt does not require support of annotation processor itself like it is necessary for Java only projects?
compile task looks incremental, but it doing something with cache very long time
Do you want the log with kapt already or still with annotationProcessor?
ra...@gmail.com <ra...@gmail.com> #11
ra...@gmail.com <ra...@gmail.com> #12
To clarify this topic, it is helpful to separate the notion of annotation processing and that of compilation.
When the Kapt plugin is not used, the JavaCompile task does both annotation processing and Java compilation. When Kapt is used, Kapt does annotation processing, KotlinCompile does Kotlin compilation, and JavaCompile does Java compilation.
For faster builds, we want all of the above 3 tasks to be incremental. Since KotlinCompile is already incremental, the focus is on making both annotation processing and Java compilation incremental.
Incremental annotation processing requires participation from the following parties:
- Gradle: This work is already complete.
- Annotation processors (ongoing):https://github.com/gradle/gradle/issues/5277
- Kapt (ongoing/has not started):https://youtrack.jetbrains.com/issue/KT-23880
Incremental Java compilation requires participation from the following parties:
- Gradle: This work is already complete.
- Annotation processors (ongoing):https://github.com/gradle/gradle/issues/5277
- No changes are required from Kapt as Kapt is not involved in Java compilation.
As you can see above, the work that annotation processor authors are doing (https://github.com/gradle/gradle/issues/5277 ) serves two purposes: It helps to make both annotation processing and Java compilation incremental. When Kapt is used, we will also need support from Kapt in order for annotation processing to be incremental.
The role of the Android Gradle plugin: Our new feature (android.enableSeparateAnnotationProcessing=true) helps make *Java compilation* incremental even when annotation processors are not yet incremental. It doesn't make annotation processing incremental, as it is outside of our scope. Again, please refer to Issue 115774858 comment #4 for more background.
When the Kapt plugin is not used, the JavaCompile task does both annotation processing and Java compilation. When Kapt is used, Kapt does annotation processing, KotlinCompile does Kotlin compilation, and JavaCompile does Java compilation.
For faster builds, we want all of the above 3 tasks to be incremental. Since KotlinCompile is already incremental, the focus is on making both annotation processing and Java compilation incremental.
Incremental annotation processing requires participation from the following parties:
- Gradle: This work is already complete.
- Annotation processors (ongoing):
- Kapt (ongoing/has not started):
Incremental Java compilation requires participation from the following parties:
- Gradle: This work is already complete.
- Annotation processors (ongoing):
- No changes are required from Kapt as Kapt is not involved in Java compilation.
As you can see above, the work that annotation processor authors are doing (
The role of the Android Gradle plugin: Our new feature (android.enableSeparateAnnotationProcessing=true) helps make *Java compilation* incremental even when annotation processors are not yet incremental. It doesn't make annotation processing incremental, as it is outside of our scope. Again, please refer to
Description
HostOS: Cygwin (on Win7)
Device: Nexus 5 (on Android 5.0.1)
NDK: version r10d
When running ndk-gdb I get the following error while it attempts to copy 'app_process' from the device:
## COMMAND: adb_cmd pull /system/bin/app_process obj/local/armeabi-v7a/app_process
remote object '/system/bin/app_process' not a file or directory
It appears that '/system/bin/app_process' is a symlink to either 'app_process32' or 'app_process64', which I understand is new to Android 5.0. But it will not pull down the dereferenced file (perhaps because it's on Cygwin/Windows?)
I injected the following code into 'ndk-gdb', line 750 to get it working... but this is obviously no good for the final product.
run adb_cmd pull /system/bin/app_process `native_path $APP_PROCESS`
### Injected Code ###
if [ $? != 0 ] ; then
run adb_cmd pull /system/bin/app_process32 `native_path $APP_PROCESS`
if [ $? != 0 ] ; then
echo "ERROR: Could not pull app_process from device/emulator."
exit 1
fi
fi
### End Injected Code ###
log "Pulled app_process from device/emulator."
As I said, I am new to NDK... so if I've done something wrong, I'd love to hear it! Thanks!