Home > Mobile >  Android Studio compile failure: reference to the findViewById not clear
Android Studio compile failure: reference to the findViewById not clear

Time:10-06

Android Studio 3.2.1
The classpath 'com. Android. Tools. Build: gradle: 3.2.1'
Gradle - 4.6 - all.zip
CompileSdkVersion 28
BuildToolsVersion '28.0.3'
All depend on the Module corresponding compileSdkVersion have been unified for 28,

Compiled code not red, but not through: "not clear" citation to the findViewById,

Try
File - & gt; Invalidate Caches/Restart
File - & gt; Sync Project with Gradle Files
Is void,

Somebody in?

CodePudding user response:

The code posted and have a look

CodePudding user response:

Kotlin or Java?
Kotlin, the findViewById need to specify type:
 
Val textView: textView=view. The findViewById (R.i which extView)
Or
Val textView=view. FindViewById (R.i which extView)


Java:
 
TextView TextView=view. The findViewById (R.i which extView);

CodePudding user response:

reference 1st floor zhang106209 response:
to post code to see

CodePudding user response:

refer to the second floor the wind light cloud light v10 reply:
kotlin or Java?
Kotlin, the findViewById need to specify type:
 
Val textView: textView=view. The findViewById (R.i which extView)
Or
Val textView=view. FindViewById (R.i which extView)


Java:
 
TextView TextView=view. The findViewById (R.i which extView);


Java, it is in the findViewById MainActivity, this problem seems to be 27 will appear, because strong cancelled

CodePudding user response:

shenzhen last handsome reference 4 floor response:
Quote: refer to the second floor the wind light cloud light v10 reply:

Kotlin or Java?
Kotlin, the findViewById need to specify type:
 
Val textView: textView=view. The findViewById (R.i which extView)
Or
Val textView=view. FindViewById (R.i which extView)


Java:
 
TextView TextView=view. The findViewById (R.i which extView);


Java, it is in the findViewById MainActivity, 27, will appear after the problem seems to be cancelled because of strong turn


Haven't met

CodePudding user response:

Whether your v7 package versions have the same up to 28?
  • Related