roam-reactnative icon indicating copy to clipboard operation
roam-reactnative copied to clipboard

Use of undeclared identifier 'Roam'

Open ThushalIntervest opened this issue 3 years ago • 20 comments

iisues

Currently, we are using, React Native : 0.68.2, we are using AppDelegate.mm files containing Objective-C++

ThushalIntervest avatar Aug 29 '22 14:08 ThushalIntervest

Hi can you initialise Roam inside

#if RCT_NEW_ARCH_ENABLED

nikhil290 avatar Aug 30 '22 05:08 nikhil290

@nikhil290 thank you, This solution work. After that when I going to create a test user, I got this error.

{
  "code": "EDATA NOT FOUND-5700246257146636005",
  "domain": "Data not found",
  "message": "The operation couldn’t be completed. (Data not found error -5700246257146636005.)",
  "nativeStackIOS": [
    "0   Wapp Dev                            0x0000000104b08530 RCTJSErrorFromCodeMessageAndNSError + 116",
    "1   Wapp Dev                            0x0000000104b0847c RCTJSErrorFromNSError + 256",
    "2   Wapp Dev                            0x0000000104a9f12c __41-[RCTModuleMethod processMethodSignature]_block_invoke_4.110 + 132",
    "3   Wapp Dev                            0x0000000104569fa4 __31-[RNRoam createUser::rejecter:]_block_invoke + 280",
    "4   Roam                                0x000000010a56c9f4 block_destroy_helper + 11744",
    "5   Roam                                0x000000010a530778 block_destroy_helper.41 + 4272",
    "6   Wapp Dev                            0x0000000104569e38 -[RNRoam createUser::rejecter:] + 276",
    "7   CoreFoundation                      0x0000000180bcddc0 48CD0A80-7A92-34EB-B140-8C475D135808 + 134592",
    "8   CoreFoundation                      0x0000000180be9e98 48CD0A80-7A92-34EB-B140-8C475D135808 + 249496",
    "9   CoreFoundation                      0x0000000180c1e2bc 48CD0A80-7A92-34EB-B140-8C475D135808 + 463548",
    "10  Wapp Dev                            0x0000000104aa117c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1828",
    "11  Wapp Dev                            0x0000000104aa4cb8 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicEiN12_GLOBAL__N_117SchedulingContextE + 1156",
    "12  Wapp Dev                            0x0000000104aa4658 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144",
    "13  Wapp Dev                            0x0000000104aa45bc ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28",
    "14  libdispatch.dylib                   0x00000001808ff094 F87EFEAD-673B-3A09-B7AB-9C69B55A18A8 + 405652",
    "15  libdispatch.dylib                   0x0000000180900094 F87EFEAD-673B-3A09-B7AB-9C69B55A18A8 + 409748",
    "16  libdispatch.dylib                   0x00000001808e1858 F87EFEAD-673B-3A09-B7AB-9C69B55A18A8 + 284760",
    "17  libdispatch.dylib                   0x00000001808e14d0 F87EFEAD-673B-3A09-B7AB-9C69B55A18A8 + 283856",
    "18  CoreFoundation                      0x0000000180bfb0c4 48CD0A80-7A92-34EB-B140-8C475D135808 + 319684",
    "19  CoreFoundation                      0x0000000180bb85e8 48CD0A80-7A92-34EB-B140-8C475D135808 + 46568",
    "20  CoreFoundation                      0x0000000180bcb240 CFRunLoopRunSpecific + 572",
    "21  GraphicsServices                    0x00000001a16c1988 GSEventRunModal + 160",
    "22  UIKitCore                           0x00000001833cb41c A84E395E-0B00-3162-B1FD-B861CE41349C + 5133340",
    "23  UIKitCore                           0x0000000183164b88 UIApplicationMain + 336",
    "24  Wapp Dev                            0x00000001045758b8 main + 104",
    "25  dyld                                0x0000000107b7c3d0 start + 444"
  ],
  "userInfo": {}
}

ThushalIntervest avatar Aug 30 '22 06:08 ThushalIntervest

Hi can you check if you making any mistake in passing publishable_key or bundle_id ?

publishable_key is empty : Data not found **Incorrect bundleId & publishable_key ** : Either publishable_key or bundle_id is wrong

nikhil290 avatar Aug 30 '22 07:08 nikhil290

xcode @nikhil290 Here are our configurations for the iOS app. but when creating users above error is occurring. We have 3 schemes dev, prod and uat for each environment. In android we used the publishable key with com.wappapp.android.dev and it worked as expected. For the iOS, we use publishable_key key with bundle_id(com.wappapp.ios.dev) but it didn't work. publishable_key same for android and iOS. if you can assist as soon as possible that will be really helpful.

ThushalIntervest avatar Aug 30 '22 08:08 ThushalIntervest

Hi @ThushalIntervest

Can you downgrade react native to 0.64.3. and check again ? Mean time Our developer looking into the above error

nikhil290 avatar Aug 31 '22 07:08 nikhil290

Thank you for the suggestion @nikhil290 🙏 . We can test with React Native 0.64.3 but we want to continue with React Native 0.68.2 Because it will impact our other Libraries. For that can you please give an update on when you found the solution for this error 🙏.

ThushalIntervest avatar Aug 31 '22 08:08 ThushalIntervest

We have the same issue. Any updates on this?

hamidhadi avatar Sep 13 '22 12:09 hamidhadi

Hi @hamidhadi @ThushalIntervest yes we are working on it and will share an update asap .

nikhil290 avatar Sep 14 '22 11:09 nikhil290

Hi @hamidhadi @ThushalIntervest https://reactnative.dev/docs/0.68/new-architecture-app-intro#ios-use-objective-c-mm-extension You can follow below steps to fix the issue

  1. Rename AppDelegate.mm to AppDelegate.m directly in xcode.
  2. Call Roam initialize before #if RCT_NEW_ARCH_ENABLED if they are not setting USE_FABRIC=1 RCT_NEW_ARCH_ENABLED=1 while installing pods.

nikhil290 avatar Sep 15 '22 06:09 nikhil290

Hi, @nikhil290 Thanks for your reply. I'm not sure we want to change the file extension as it might affect other turbo modules.

hamidhadi avatar Sep 15 '22 08:09 hamidhadi

@hamidhadi true, I did the same thing previously. it didn't work and after kill sometimes the app crashed and the location tracking not worked.

ThushalIntervest avatar Sep 15 '22 08:09 ThushalIntervest

Hi @hamidhadi it is working from our end , we are trying to replicate it the above mentioned crash and will update you soon

nikhil290 avatar Sep 15 '22 09:09 nikhil290

@nikhil290 Even if that works now, we can't ensure that it won't affect the other libraries as your proposed solution is changing the RN signature. Still, I tried to run the app after applying your solution, and I'm getting the following error:

Error: NativeModules.RNRoam is undefined, js engine: hermes

hamidhadi avatar Sep 15 '22 10:09 hamidhadi

@hamidhadi for that you need to,

  • Open the iOS module files, located inside node_modules/roam-reactnative/ios/.
  • Open the app workspace file (AppName.xcworkspace) in Xcode.
  • Move the RNRoam.h and RNRoam.m files to your project. When shown a popup window, select Create groups.

ThushalIntervest avatar Sep 15 '22 11:09 ThushalIntervest

Thanks, @ThushalIntervest! I believe the auto-linking issue was supposed to be fixed as part of this release

hamidhadi avatar Sep 15 '22 11:09 hamidhadi

you welcome @hamidhadi . is this works for you?

Hi @hamidhadi @ThushalIntervest https://reactnative.dev/docs/0.68/new-architecture-app-intro#ios-use-objective-c-mm-extension You can follow below steps to fix the issue

  1. Rename AppDelegate.mm to AppDelegate.m directly in xcode.
  2. Call Roam initialize before #if RCT_NEW_ARCH_ENABLED if they are not setting USE_FABRIC=1 RCT_NEW_ARCH_ENABLED=1 while installing pods.

ThushalIntervest avatar Sep 15 '22 11:09 ThushalIntervest

@ThushalIntervest @hamidhadi Can you confirm if the solution provided is working for you or you still facing any issue ?

nikhil290 avatar Sep 20 '22 12:09 nikhil290

@nikhil290 Previously I have done this method and it didn't work(Location Not Tracked) in the App Kill state(iOS). And also I think this is unsuitable for a new RN architecture. It will affect the other thrid party dependencies.

ThushalIntervest avatar Sep 20 '22 12:09 ThushalIntervest

Hi @ThushalIntervest we built an example app and added the same below solution for react native new architecture (0.68.2) as mentioned above

  1. Rename AppDelegate.mm to AppDelegate.m directly in xcode.
  2. Call Roam initialize before #if RCT_NEW_ARCH_ENABLED if they are not setting USE_FABRIC=1 RCT_NEW_ARCH_ENABLED=1 while installing pods.

Steps: Request permission Create user -> user id and response displayed in app toggle listener start tracking -> locations successfully displayed in app and published to server as well

We are able to start the tracking can we connect on call along with our developer to get into the root cause ?

https://calendly.com/d/dsd-y9r-xdf/technical-support-working-hours

nikhil290 avatar Sep 23 '22 11:09 nikhil290

We decided not to move forward with Roam at this point.

hamidhadi avatar Sep 27 '22 14:09 hamidhadi