ibitcy / react-native-hole-view

✂️ React-Native component to cut a touch-through holes anywhere you want. Perfect solution for tutorial overlay
364 stars 20 forks source link

Build generation failed on Android : > Task :react-native-hole-view:compileReleaseKotlin FAILED #23

Closed ronlobo01 closed 9 months ago

ronlobo01 commented 1 year ago

Getting the following errors while generating the Android build

> Task :react-native-hole-view:compileReleaseKotlin FAILED

'onDraw' overrides nothing is Canvas? but Canvas was expected 'dispatchDraw' overrides nothing Type mismatch: inferred type is Canvas? but Canvas was expected

Need some help!

stephenkopylov commented 1 year ago

Please try version 3.0.0-alpha3. It still needs some testing but should work.

vitorclelis96 commented 11 months ago

I'm also having this issue - @ronlobo01 were you able to fix it?

stephenkopylov commented 11 months ago

@vitorclelis96 have you tried v.3.0.0-alpha3?

vitorclelis96 commented 11 months ago

Hey @stephenkopylov Thank you for the reply - I have 'patch-packaged' it and my build worked:

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 03347d4..ec18da3 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
@@ -176,14 +176,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)
stephenkopylov commented 9 months ago

Closing because of inactivity