Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':react-native-hole-view:compileDebugKotlin'. #34

Open
KarkG opened this issue Jul 18, 2024 · 1 comment
Open

Comments

@KarkG
Copy link

KarkG commented Jul 18, 2024

I am using this package in my Expo managed project.

When creating a build for Android using eas build -p android --profile development, the build fails with these logs:

...
> Task :react-native-hole-view:compileDebugKotlin FAILED
e: file:///home/expo/workingdir/build/project/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt:183:5 'onDraw' overrides nothing
e: file:///home/expo/workingdir/build/project/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt:184:22 Type mismatch: inferred type is Canvas? but Canvas was expected
e: file:///home/expo/workingdir/build/project/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt:190:5 'dispatchDraw' overrides nothing
e: file:///home/expo/workingdir/build/project/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt:191:28 Type mismatch: inferred type is Canvas? but Canvas was expected
...
...
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-hole-view:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

Any suggestions as to how to fix this?

@SarjuHansaliya
Copy link

@KarkG till author fixes this issue, you can use this patch

diff --git a/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt b/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt
index 7edbfeb..78eafc1 100644
--- a/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt
+++ b/node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleView.kt
@@ -180,14 +180,14 @@ class RNHoleView(context: Context) : ReactViewGroup(context) {
         mHoles.addAll(holes)
     }
 
-    override fun onDraw(canvas: Canvas?) {
+    override fun onDraw(canvas: Canvas) {
         super.onDraw(canvas)
         if (mHolesPath != null) {
             canvas?.drawPath(mHolesPath!!, mHolesPaint)
         }
     }
 
-    override fun dispatchDraw(canvas: Canvas?) {
+    override fun dispatchDraw(canvas: Canvas) {
         super.dispatchDraw(canvas)
         if (mHolesPath != null) {
             canvas?.drawPath(mHolesPath!!, mHolesPaint)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants