I have created a RN module. No error there, But i am not getting suggestions and compile time error detection auto complete , references and usage and all.
I have made the module with create-react-native-library
If I import entire project dir (which includes ios, android dir) then gradle is synced but no features works while coding.
If I only import android directory, it throws errors and sync fails.
Error:
gradleCould not create task ‘:generateDebugRFile’.
Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
Edit: I was able to fix above error. then it has error as
Failed to resolve: com.facebook.react:react-native+
I am looking for a proper way to write code for react native android (java, kotlin)
2
Answers
Solved and working like charm.
now my RN module also synced nicley and all features are working fine.
The error message you provided suggests that there is an issue with using the @TaskAction annotation on the taskAction$gradle_core() method of an IncrementalTask because the IncrementalTaskInputs interface is not a valid parameter for an action method.
Android Native Modules : https://reactnative.dev/docs/native-modules-android
Running a React Native App on Android Studio A Step-by-Step Guide : https://groovetechnology.com/blog/running-a-react-native-app-on-android-studio-a-step-by-step-guide/
Dive into React Native for Android Development :
https://www.toptal.com/react-native/react-native-for-android-development
How to integrate Native modules in React Native Apps ? Explained : https://medium.com/@gopesh.jangid/how-to-integrate-native-modules-in-react-native-apps-explained-355bab3cab90#:~:text=To%20use%20the%20native%20module,name%20from%20the%20specified%20library
Could not create task ‘:app:compileDebugKotlin’ : https://discuss.gradle.org/t/could-not-create-task-compiledebugkotlin/46992
Import fails with GradleException: Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() : https://youtrack.jetbrains.com/issue/KTIJ-27599/Import-fails-with-GradleException-Cannot-use-TaskAction-annotation-on-method-IncrementalTask.taskActiongradlecore
how to solve cannot use taskaction annotation on : https://slack-chats.kotlinlang.org/t/12356096/anyone-know-how-to-solve-cannot-use-taskaction-annotation-on
Upgrading your build from Gradle 7.x to 8.0 :
https://docs.gradle.org/current/userguide/upgrading_version_7.html