Repository navigation
MainActivity_ is not abstract and does not override abstract method findViewById(int) in HasViews #2001
Description
Activity
The Problem is that Google changed the signature of thier
findViewByIdin AndroidOfromView findViewById(int id)to something like<T extends View> T findViewById(int id)(not exactly sure how the new syntax looks, saw that yesterday in one of the I/O streams).And we have our
org.androidannotations.api.view.HasViewsinterface that has this method with the old syntax and until AndroidOthe implementation came from theActivityclass. but with this change on thier side they broke our interface...looks like for now we unfortunately do not support Android
Odue to this change.@WonderCsabo any idea for a good fix?
Reacted by DwyaneTyroneWadeI would suggest to generate the old,
findViewByIdmethod, but unfortunately that would not compile, because both methods have the same erasure. The only solution i see is introducing aHasViews2interface, and implement that ifcompileSdkVersion>= Android O .@WonderCsabo Any update on the issue? Is it possible just to rename
findViewByIdmethod?A PR to adress this issue is up.
@naixx no, we cannot just rename the method, because the generated code actually rely on implementing it implicitly by
Activity.Gradle add: maven { url 'https://jitpack.io' }.
buildscript {
repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}task clean(type: Delete) {
delete rootProject.buildDir
}AND:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'//annotation compile 'org.androidannotations:androidannotations-api:4.3.1' annotationProcessor 'org.androidannotations:androidannotations:4.3.1' implementation 'com.jakewharton:butterknife:8.8.1'}
Reacted by Jason, Marcos Felipe Souza and Mehul Tank@phanminhthu can you explain what you are adding there?
What is the solutions for "MainActivity_ is not abstract and does not override abstract method findViewById(int) in HasViews" ?????
I solved ...
I putted on version 4.4.0 , and It has the method "findViewById(int) in HasViews"Reacted by Redouane Oubenal, Marcos Felipe Souza, Pawan Shahani, Top Coders, hcz017, Edilson souza, Gustavo Cavalieri Fernandes, Gnanaoly, Samuel Reque Zambrana, Chris McIntyre and 5 moreReacted by Trương Ngọc Linh and Marcos Felipe Souza@marcosjava nice !!!
Reacted by Marcos Felipe SouzaI solved ...
I putted on version 4.4.0 , and It has the method "findViewById(int) in HasViews"com.android.tools.build:gradle version ?
I solved ...
I putted on version 4.4.0 , and It has the method "findViewById(int) in HasViews"com.android.tools.build:gradle version ?
sim
I solved ...
I putted on version 4.4.0 , and It has the method "findViewById(int) in HasViews"com.android.tools.build:gradle version ?
sim
classpath 'com.android.tools.build:gradle:2.3.1'
Gradle 4.6
I try to compile sample project with Android Studio 3.0-preview1 and Support Library 26.0.0-beta1 but get an compile time error "MainActivity_ is not abstract and does not override abstract method findViewById(int) in HasViews"
AndroidAnnotations version:
4.3.0
Android compile SDK version:
android-O
Project build config:
Module build config:
Annotated code:
Expected generated code:
Actual generated code:
Stacktrace in case of AA crash:
MainActivity_ is not abstract and does not override abstract method findViewById(int) in HasViews