android studio unresolved reference - android

I try to run my app and get this errors
e: /Users/idanfadlon/Desktop/Law-Tech-App/app/src/main/java/com/example/law_tech_app/fragments/BaseFragment.kt: (11, 24): Unresolved reference: synthetic
2.e: /Users/idanfadlon/Desktop/Law-Tech-App/app/src/main/java/com/example/law_tech_app/fragments/BaseFragment.kt: (19, 25): Unresolved reference: tv_progress_text
3.e: /Users/idanfadlon/Desktop/Law-Tech-App/app/src/main/java/com/example/law_tech_app/fragments/BaseFragment.kt: (19, 42): Variable expected
the problem is in base activity file and I dont touch him
I try to pull project again from my repository

Related

Unresolved reference: MifosNotification_Table

When I try to run my app i get the following error:
Unresolved reference: MifosNotification_Table
I tried different versions and still no difference

Dependencie fail via kotlin compilation

I need to add this react-native-screens dependence into my app and when I run android build this dependence fails
> Task :react-native-screens:compileDebugKotlin FAILED
I am implementing a react-native app (as a module) into an existing native app. And this app is completely in Kotlin. I follow the official doc and all looks fine but this lib has some problem
this is the error that I have in the android studio:
e: /Users/lk/Docu....reens/RNScreensPackage.kt: (9, 1):
Class 'RNScreensPackage' is not abstract and does not implement abstract member public
abstract fun createJSModules(): (Mutable)List<Class<out JavaScriptModule!>!>!
defined in com.facebook.react.ReactPackage
and this is what i have when i run react-native run-android
> Task :react-native-screens:compileDebugKotlin FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
50 actionable tasks: 16 executed, 34 up-to-date
e: /pathtoproject/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt: (9, 1): Class 'RNScreensPackage' is not abstract and does not implement abstract member public abstract fun createJSModules(): (Mutable)List<Class<out JavaScriptModule!>!>! defined in com.facebook.react.ReactPackage
e: /pathtoproject/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt: (11, 34): Unresolved reference: GuardedRunnable
e: /pathtoproject/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt: (77, 13): Type mismatch: inferred type is <no name provided> but Runnable! was expected
e: /pathtoproject/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt: (77, 22): Unresolved reference: GuardedRunnable
e: /pathtoprojectnode_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt: (78, 17): 'runGuarded' overrides nothing
e: /Upathtoproject/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt: (81, 27): Unresolved reference: updateNodeSize
e: /pathtoproject/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt: (15, 40): Unresolved reference: ChoreographerCompat
...and more

Cannot build Flutter App (Android) after install wechat_assets_picker

I recently installed wechat_assets_picker, however when trying to build for android I get the following error, nothing in thier docs about it and no issues on thier issue list either.
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/PhotoManagerDeleteManager.kt: (116, 36): Unresolved reference: R
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/PhotoManagerDeleteManager.kt: (119, 36): Unresolved reference: createTrashRequest
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/PhotoManagerPlugin.kt: (341, 84): Unresolved reference: R
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/utils/Android30DbUtils.kt: (34, 34): Unresolved reference: R
e: /Users/remelehane/.pub-cache/hosted/pub.dartlang.org/photo_manager-0.6.0/android/src/main/kotlin/top/kikt/imagescanner/core/utils/IDBUtils.kt: (27, 67): Unresolved reference: R
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':photo_manager:compileReleaseKotlin'.
> Compilation error. See log for more details
The erroring line is #RequiresApi(Build.VERSION_CODES.R) which from what I understand means this function on runs in version R of the android SDK, which is OS11, so should not be affecting the build?
I checked with the example project which is running SDK min 21 and compiled of 29.
Mine is running 19 and 21, however changign to 21 did not get around the build error so there must be more to is than that?
TIA
The issue is as a result of the compiledSdkVersion being set to 29, it needs to be set to 30
Each time you upgrade your pubspecs, or run a pub upgrade, you need to run flutter clean. And it should solved. Specific to the photo_manager.

Android project in koltin fails when execute ./gradlew build in terminal but works when run from menu

I'm trying to work with Travis CI, and previously I have try to build my project in the Android Studio's terminal with ./gradlew build or with ./gradlew clean build but both throws "Execution failed for task ':presentation:compileReleaseKotlin'." however when I build my project from the Android Studio's toolbar it works perfectly.
You can see the whole stacktrace and all the information here gradle stacktrace
Thanks in advance,
Javi
Check your Constants class for errors.
e: /Users/jcamarero/AndroidStudioProjects/boton/presentation/src/main/java/com/b4motion/boton/utils/Constants.kt: (48, 31): Const 'val' initializer should be a constant value
e: /Users/jcamarero/AndroidStudioProjects/boton/presentation/src/main/java/com/b4motion/boton/utils/Constants.kt: (48, 46): Unresolved reference: URL_WEB_VIEW
e: /Users/jcamarero/AndroidStudioProjects/boton/presentation/src/main/java/com/b4motion/boton/utils/Constants.kt: (49, 29): Const 'val' initializer should be a constant value
e: /Users/jcamarero/AndroidStudioProjects/boton/presentation/src/main/java/com/b4motion/boton/utils/Constants.kt: (49, 44): Unresolved reference: URL_WEB_VIEW
This error says that you have a const val in your Constants class defined but it is not constant at compile time. Also, it cannot find reference to URL_WEB_VIEW.

Error:Execution failed for task ':app:compileDebugKotlinAfterJava'

Information:Gradle tasks [:app:assembleDebug]
/Users/liwei/Desktop/Schedule/app/src/main/java/com/schedule/MainActivity.kt
Error:(5, 16) Unresolved reference: os
Error:(12, 8) Unresolved reference: java
Error:(13, 8) Unresolved reference: java
Error:(21, 5) 'onCreate' overrides nothing
Error:(21, 47) Unresolved reference: Bundle
Error:(27, 26) Unresolved reference: SimpleDateFormat
Error:(28, 20) Unresolved reference: Date
Error:(28, 25) Unresolved reference: System
Error:(31, 19) Unresolved reference: Calendar
Error:(35, 41) Unresolved reference: Calendar
Error:(46, 47) Type mismatch: inferred type is MainActivity but Context was expected
Error:(49, 25) Type mismatch: inferred type is kotlin.String but java.lang.String was expected
Error:(50, 24) The integer literal does not conform to the expected type Object
Error:(52, 45) Type mismatch: inferred type is MainActivity but Context was expected
Error:(55, 25) Type mismatch: inferred type is kotlin.String but java.lang.String was expected
Error:(56, 24) The integer literal does not conform to the expected type Object
Error:(58, 45) Type mismatch: inferred type is MainActivity but Context was expected
Error:(61, 25) Type mismatch: inferred type is kotlin.String but java.lang.String was expected
Error:(62, 24) The integer literal does not conform to the expected type Object
Error:(64, 44) Type mismatch: inferred type is MainActivity but Context was expected
Error:(67, 25) Type mismatch: inferred type is kotlin.String but java.lang.String was expected
Error:(68, 24) The integer literal does not conform to the expected type Object
Error:(70, 37) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val [ERROR : ].tab: PagerBottomTabLayout! defined in kotlinx.android.synthetic.main.activity_main
Error:(84, 5) Class 'OnTabItemlistener' must be declared abstract or implement abstract member public abstract fun onSelected(p0: Int, p1: Object!): Unit defined in me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectListener
Error:(85, 9) 'onSelected' overrides nothing
Error:(86, 19) Unresolved reference: UnsupportedOperationException
Error:(89, 9) 'onRepeatClick' overrides nothing
Error:(90, 19) Unresolved reference: UnsupportedOperationException
Error:Execution failed for task ':app:compileDebugKotlinAfterJava'.
Compilation error. See log for more details
Information:BUILD FAILED
Information:Total time: 8.812 secs
Information:29 errors
Information:0 warnings
Information:See complete output in console
Kotlin Error
I don‘t down
Always appear this type of problem
Please
Help
Thanks
First of all, check if you have done all steps described in article below correctly: https://kotlinlang.org/docs/tutorials/kotlin-android.html
Then check which kotlin-plugin are you're already using. Hope you're not using 1.0.4 version and you chose Stable channel for kotlin updates, if not please downgrade it and rebuild projects.
There are some known issues dealing Kotlin with Data Binding library. Please, if possible - remove all its dependencies and rewrite binded code using kotlin-extensions library. Trust me, you don't need this library, when you're using code.
Then choose File -> Invalidate Caches, after invalidating and restart android studio, clean and rebuild your project.
Hope it will help
maybe u change version Kotlin language to ext.kotlin_version = '1.0.2-1'
by
https://github.com/djuarez/KotlinCleanArchitecture/blob/master/build.gradle

Categories

Resources