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

> Task :ua_react-native-airship:compileDebugKotlin FAILED #627

Open
rberg-ct opened this issue Feb 27, 2025 · 13 comments
Open

> Task :ua_react-native-airship:compileDebugKotlin FAILED #627

rberg-ct opened this issue Feb 27, 2025 · 13 comments

Comments

@rberg-ct
Copy link

latest react-native cli version 0.78 fresh project

added latest airship library
"@ua/react-native-airship": "^21.2.0",

will not compile

Task :ua_react-native-airship:compileDebugKotlin FAILED

have tried rolling airship library to some other older versions and still no luck

@JorenVos
Copy link

JorenVos commented Feb 27, 2025

Can confirm that this version does not work with 0.78.

e: app/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt:16:28 Cannot infer type for this parameter. Please specify it explicitly.
e: app/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt:16:66 Argument type mismatch: actual type is 'com.urbanairship.reactnative.ReactEmbeddedViewManager', but 'U!' was expected.
e: app/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt:16:28 Cannot infer type for this parameter. Please specify it explicitly.
e: app/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt:16:65 Argument type mismatch: actual type is 'com.urbanairship.reactnative.ReactMessageViewManager', but 'U!' was expected.
kotlinVersion = "2.0.21"

@jyaganeh
Copy link
Contributor

Hi @rberg-ct and @JorenVos, I've reproduced this locally and am working on a fix. Will circle back to let you know when it's released.

@war-in
Copy link

war-in commented Feb 28, 2025

Hi 👋 I'm also facing this problem.
The error is different, so I'm gonna put it here

@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt:22:53 Type argument is not within its bounds: should be subtype of 'android.view.View'.

@jyaganeh Could you please share an update once the PR (draft) is opened? I'm going to patch it even before the release so I can build the app. Thank you!

@JorenVos
Copy link

JorenVos commented Mar 4, 2025

@jyaganeh Any update? We're stuck on building our apps.

@rlepinski
Copy link
Contributor

We are still working on this. The module template we used to update the plugin a few years ago is pretty out of date and is the old way of delivering turbo modules. We are regenerating a template base and trying to port our changes to it. Hoping to have something in the next day or so

@JorenVos
Copy link

JorenVos commented Mar 6, 2025

Is it possible to provide a temporary workaround or quick fix? We're stuck on building our app locally for almost a week.

@samueljim
Copy link

BUMP on this.

Thanks for your helps everyone

@JorenVos
Copy link

JorenVos commented Mar 7, 2025

I have just created the following patch-package. I’m not sure if it breaks any features (at first glance everything seems to work), but at the very least, we can build the app again.

@ua+react-native-airship+21.2.0.patch

diff --git a/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt b/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt
index a8d2864..b640bfd 100644
--- a/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt
+++ b/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt
@@ -6,21 +6,35 @@ import com.facebook.react.uimanager.SimpleViewManager
 import com.facebook.react.uimanager.ThemedReactContext
 import com.facebook.react.uimanager.ViewManagerDelegate
 import com.facebook.react.uimanager.annotations.ReactProp
-import com.facebook.react.viewmanagers.RTNAirshipEmbeddedViewManagerDelegate
 import com.facebook.react.viewmanagers.RTNAirshipEmbeddedViewManagerInterface
 
-
 class ReactEmbeddedViewManager : SimpleViewManager<ReactEmbeddedView>(),
     RTNAirshipEmbeddedViewManagerInterface<ReactEmbeddedView> {
 
-    private val delegate = RTNAirshipEmbeddedViewManagerDelegate(this)
+    private val manualDelegate = object : ViewManagerDelegate<ReactEmbeddedView?> {
+
+        override fun setProperty(view: ReactEmbeddedView?, propName: String?, value: Any?) {
+            if (view == null || propName == null) return
+
+            when (propName) {
+                "embeddedId" -> setEmbeddedId(view, value as? String)
+                else -> {
+                    
+                }
+            }
+        }
+
+        override fun receiveCommand(view: ReactEmbeddedView?, commandName: String?, args: com.facebook.react.bridge.ReadableArray?) {
+            // No commands supported — add if you need any
+        }
+    }
 
     override fun getName(): String {
         return REACT_CLASS
     }
 
     override fun getDelegate(): ViewManagerDelegate<ReactEmbeddedView?> {
-        return delegate
+        return manualDelegate
     }
 
     override fun createViewInstance(reactContext: ThemedReactContext): ReactEmbeddedView {
@@ -34,7 +48,6 @@ class ReactEmbeddedViewManager : SimpleViewManager<ReactEmbeddedView>(),
         }
     }
 
-
     companion object {
         const val REACT_CLASS = "RTNAirshipEmbeddedView"
     }
diff --git a/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt b/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt
index 13bba74..22741b7 100644
--- a/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt
+++ b/node_modules/@ua/react-native-airship/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt
@@ -7,13 +7,29 @@ import com.facebook.react.uimanager.SimpleViewManager
 import com.facebook.react.uimanager.ThemedReactContext
 import com.facebook.react.uimanager.ViewManagerDelegate
 import com.facebook.react.uimanager.annotations.ReactProp
-
-import com.facebook.react.viewmanagers.RTNAirshipMessageViewManagerDelegate
 import com.facebook.react.viewmanagers.RTNAirshipMessageViewManagerInterface
+import com.facebook.react.bridge.ReadableArray
+
+class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(), 
+    RTNAirshipMessageViewManagerInterface<ReactMessageView> {
+
+    private val delegate = object : ViewManagerDelegate<ReactMessageView?> {
+
+        override fun setProperty(view: ReactMessageView?, propName: String?, value: Any?) {
+            if (view == null || propName == null) return
 
-class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(), RTNAirshipMessageViewManagerInterface<ReactMessageView> {
+            when (propName) {
+                "messageId" -> setMessageId(view, value as? String)
+                else -> {
                     
-    private val delegate = RTNAirshipMessageViewManagerDelegate(this)
+                }
+            }
+        }
+
+        override fun receiveCommand(view: ReactMessageView?, commandName: String?, args: ReadableArray?) {
+            // No commands implemented, add if Airship adds some in future
+        }
+    }
 
     override fun getName(): String {
         return REACT_CLASS
diff --git a/node_modules/@ua/react-native-airship/android/src/oldarch/java/com/facebook/react/viewmanagers/RTNAirshipEmbeddedViewManagerDelegate.java b/node_modules/@ua/react-native-airship/android/src/oldarch/java/com/facebook/react/viewmanagers/RTNAirshipEmbeddedViewManagerDelegate.java
deleted file mode 100644
index dafdb38..0000000
--- a/node_modules/@ua/react-native-airship/android/src/oldarch/java/com/facebook/react/viewmanagers/RTNAirshipEmbeddedViewManagerDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
-* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
-*
-* Do not edit this file as changes may cause incorrect behavior and will be lost
-* once the code is regenerated.
-*
-* @generated by codegen project: GeneratePropsJavaDelegate.js
-*/
-
-package com.facebook.react.viewmanagers;
-
-import android.view.View;
-import androidx.annotation.Nullable;
-import com.facebook.react.uimanager.BaseViewManagerDelegate;
-import com.facebook.react.uimanager.BaseViewManagerInterface;
-
-public class RTNAirshipEmbeddedViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RTNAirshipEmbeddedViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
-  public RTNAirshipEmbeddedViewManagerDelegate(U viewManager) {
-    super(viewManager);
-  }
-  @Override
-  public void setProperty(T view, String propName, @Nullable Object value) {
-    switch (propName) {
-      case "embeddedId":
-        mViewManager.setEmbeddedId(view, value == null ? null : (String) value);
-        break;
-      default:
-        super.setProperty(view, propName, value);
-    }
-  }
-}
diff --git a/node_modules/@ua/react-native-airship/android/src/oldarch/java/com/facebook/react/viewmanagers/RTNAirshipMessageViewManagerDelegate.java b/node_modules/@ua/react-native-airship/android/src/oldarch/java/com/facebook/react/viewmanagers/RTNAirshipMessageViewManagerDelegate.java
deleted file mode 100644
index 4fffc86..0000000
--- a/node_modules/@ua/react-native-airship/android/src/oldarch/java/com/facebook/react/viewmanagers/RTNAirshipMessageViewManagerDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
-* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
-*
-* Do not edit this file as changes may cause incorrect behavior and will be lost
-* once the code is regenerated.
-*
-* @generated by codegen project: GeneratePropsJavaDelegate.js
-*/
-
-package com.facebook.react.viewmanagers;
-
-import android.view.View;
-import androidx.annotation.Nullable;
-import com.facebook.react.uimanager.BaseViewManagerDelegate;
-import com.facebook.react.uimanager.BaseViewManagerInterface;
-
-public class RTNAirshipMessageViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RTNAirshipMessageViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
-  public RTNAirshipMessageViewManagerDelegate(U viewManager) {
-    super(viewManager);
-  }
-  @Override
-  public void setProperty(T view, String propName, @Nullable Object value) {
-    switch (propName) {
-      case "messageId":
-        mViewManager.setMessageId(view, value == null ? null : (String) value);
-        break;
-      default:
-        super.setProperty(view, propName, value);
-    }
-  }
-}

@rlepinski
Copy link
Contributor

Thanks for the patch. While we struggle to get the new plugin in place Ill test these changes out and see if I can get a release out with it. If you are not using any of the views it should be fine though. I am pretty sure it will break older react versions but we can do a new react only release if needed.

@rlepinski
Copy link
Contributor

#629

We almost have it. Lot of random issues that we got stuck on moving to the new module scaffolding. Ill try to do the last remaining TODOs over the weekend but it might be Monday before we get it out.

So far I got it building and tested new arch that I can call takeOff and show a MessageView on both platforms.

@JorenVos
Copy link

JorenVos commented Mar 10, 2025

I am using the old architecture for my project, so please don't forget to test it as well 😄

@rlepinski
Copy link
Contributor

rlepinski commented Mar 11, 2025

I hit an issue with the fabric view on iOS was being picked up as a paper view. It too way too long to figure out. It's now the end of my day though so Ill have to continue getting it ready tomorrow.

@crow
Copy link
Contributor

crow commented Mar 11, 2025

@JorenVos @samueljim @rberg-ct @war-in react-native-airship version 22.0.0 is now available. We'll follow up with a new example app and doc improvements outlining the full version support details. We appreciate your patience.

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

7 participants