Status Update
Comments
uc...@google.com <uc...@google.com>
vs...@google.com <vs...@google.com>
ra...@google.com <ra...@google.com> #2
I wasn't able to reproduce by creating a dummy library with a KotlinBaseActivity extending AppCompatActivity and copying the resulting aar into the app's libs/ folder. I'm also using version 1.1.50.
li...@bytedance.com <li...@bytedance.com> #3
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}
My KotlinBaseActivity is in maven lib.
po...@gmail.com <po...@gmail.com> #4
[Deleted User] <[Deleted User]> #5
tn...@google.com <tn...@google.com> #6
[Deleted User] <[Deleted User]> #7
Android Studio 3.1 Beta 2
Build #AI-173.4580418, built on February 1, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6
tn...@google.com <tn...@google.com> #8
[Deleted User] <[Deleted User]> #9
Overriding a class from the *same* project does not show the tooltip.
More specifically to our situation:
We have an internal android project of common libraries used with different applications. This project modularizes the android libraries based on their features (i.e bluetooth, analytics, core, etc). Each library is published on a private artifactory server.
We then have a separate project for each android application we make. These projects have a single android app module that imports the necessary library modules via gradle. When we extend a class from the imported module and override a function annotated with @CallSuper we see the tooltip show with a red underline indicating there is an error. The same error is shown with and without the call to super.
So say our Core library has a BasePresenter class like the following:
open class BasePresenter() {
@CallSuper
fun created(){
// some basic logic
}
}
then when imported into an Application's project (with gradle) and overwritten as follows:
open class ActivityPresenter : BasePresenter() {
override fun created(){
super.created()
// some extra logic.
}
}
the IDE shows the tooltip "Overriding method should call super.created" and has a red underline below "created".
Keep in mind if we go a step further and add the @CallSuper annotation above the created() function in ActivityPresenter and extend it like the following:
open class SecondActivityPresenter : ActivityPresenter() {
override fun created(){
super.created()
// some more extra logic.
}
}
We see the expected behavior, no error/warning tooltip is shown unless the call to super.created() is deleted.
[Deleted User] <[Deleted User]> #10
[Deleted User] <[Deleted User]> #11
To work with Android Studio 3.1 Beta 2 I upgraded:
- buildToolsVersion from 27.0.1 to 27.0.3
- gradle from 3.1.0-alpha04 to 3.1.0-beta2
Now when I run lintDebug it fails due to the missing super call where as previously this did not fail because of it.
[Deleted User] <[Deleted User]> #12
tn...@google.com <tn...@google.com> #13
[Deleted User] <[Deleted User]> #14
Just open the SuperErrorExampleApp and look at the ExampleActivity. You should see an error on the onCreate method.
tn...@google.com <tn...@google.com> #16
al...@gmail.com <al...@gmail.com> #18
AI-203.7717.56.2031.7935034, JRE 11.0.10+0-b96-7249189x64 JetBrains s.r.o., OS Linux(amd64) v5.13.0-22-generic, screens 1920.0x1080.0
AS: Arctic Fox | 2020.3.1 Patch 4; Kotlin plugin: 203-1.6.10-release-923-AS7717.8; Android Gradle Plugin: 4.0.1; Gradle: 6.1.1; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
class TestActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
p....@radio.net <p....@radio.net> #19
This bug seems to be back. Currently in Electric Eel, but I think I saw it in Dolphin as well
Android Studio Electric Eel | 2022.1.1 Canary 9
Build #AI-221.5921.22.2211.8881706, built on July 28, 2022
Kotlin Plugin Version: 221-1.7.10-release-for-android-studio-AS5591.52
Runtime version: 11.0.13+0-b1751.21-8125866 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
ko...@gmail.com <ko...@gmail.com> #20
calling super but still warning "Overriding method should call super.onNewIntent"
ji...@gmail.com <ji...@gmail.com> #21
I have the same issue on the stable version of Android Studio (Chipmunk) with the onSaveInstanceState(outState: Bundle)
method.
override fun onSaveInstanceState(outState: Bundle) {
// I'm putting some data to the out state here.
super.onSaveInstanceState(outState)
}
Android Studio Chipmunk | 2021.2.1 Patch 2
Build #AI-212.5712.43.2112.8815526, built on July 10, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: idea.plugin.protoeditor (212.5080.8), org.zalando.intellij.swagger (1.1.2), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46)
ke...@gmail.com <ke...@gmail.com> #22
override fun onNewIntent(intent: Intent) {
super.onNextIntent(intent)
... all my code follows
}
[Deleted User] <[Deleted User]> #23
km...@gmail.com <km...@gmail.com> #24
Same here with onNewIntent
, apparently since upgrading appcompat from 1.6.0 to 1.6.1
Using Kotlin 1.8.0
Android Studio Electric Eel | 2022.1.1 Patch 1
Build #AI-221.6008.13.2211.9514443, built on January 20, 2023
Runtime version: 11.0.15+0-b2043.56-8887301 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.1.12-x64v3-xanmod1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 20
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
Current Desktop: ubuntu:GNOME
pa...@outlook.com <pa...@outlook.com> #25
Can confirm that this 6yo bug has resurfaced.
I am also using AS Electric Eel Patch 1, this version has been the most unstable and bug ridden "stable" version of Android Studio so far, it is insane.
rb...@gmail.com <rb...@gmail.com> #26
Facing the same issue while using onNewIntent
Android Studio Electric Eel | 2022.1.1 Patch 2 Build #AI-221.6008.13.2211.9619390, built on February 17, 2023 Runtime version: 11.0.15+0-b2043.56-8887301 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.19.0-35-generic GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false
Non-Bundled Plugins: wu.seal.tool.jsontokotlin (3.7.4) com.intellij.marketplace (221.6008.18) zielu.gittoolbox (500.0.4+213) izhangzhihao.rainbow.brackets (2023.2.6-ij) com.suusan2go.kotlin-fill-class (1.0.17)
Current Desktop: ubuntu:GNOME
ac...@gmail.com <ac...@gmail.com> #27
Android Studio Dolphin | 2021.3.1
Build #AI-213.7172.25.2113.9014738, built on August 31, 2022
Runtime version: 11.0.13+0-b1751.21-8125866 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
zh...@gmail.com <zh...@gmail.com> #28
le...@gmail.com <le...@gmail.com> #29
co...@gmail.com <co...@gmail.com> #30
I'm still seeing this in Giraffe:
Android Studio Giraffe | 2022.3.1 Patch 2 Build #AI-223.8836.35.2231.10811636, built on September 14, 2023 Runtime version: 17.0.6+0-17.0.6b829.9-10027231 x86_64
do...@gmail.com <do...@gmail.com> #31
Still the same with onNewIntent.
Android Studio Giraffe | 2022.3.1 Patch 2 Build #AI-223.8836.35.2231.10811636, built on September 15, 2023 Runtime version: 17.0.6+0-b2043.56-10027231 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 12 Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false
Non-Bundled Plugins: com.intellij.ideolog (222.1.0.0) com.knziha.vectorpathtweaker (1.9.1) Statistic (4.2.7) com.thoughtworks.gauge (223.7571.182) com.moxun.plugin.s2v (1.9.2)
do...@gmail.com <do...@gmail.com> #32
The bug here is wider. Lint is wrongfully integrating dependencies from all gradle build scripts from the modules. This is the same bug as in my question and answer
sw...@gmail.com <sw...@gmail.com> #33
Build #AI-231.9392.1.2311.11076708, built on November 10, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
gi...@gmail.com <gi...@gmail.com> #34
Android Studio Hedgehog | 2023.1.1
Build #AI-231.9392.1.2311.11076708, built on November 9, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
This warning is shown on onNewIntent override method
gm...@googlemail.com <gm...@googlemail.com> #35
Android Studio Iguana | 2023.2.1 Patch 1
Build #AI-232.10300.40.2321.11567975, built on March 13, 2024
Runtime version: 17.0.9+0-17.0.9b1087.7-11185874 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Shown on onNewIntent method
Description
AI-171.4333198, JRE 1.8.0_152-release-915-b01x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.12.4 unknown, screens 1440x900, 1920x1080; Retina
Kotlin plugin: 1.1.50
Code:
open class TestActivity : KotlinBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}
KotlinBaseActivity in AAR(maven)
Alway tips "Overriding method should call super.onCreate".