Closed Johennes closed 1 month ago
Possibly related: The Android build fails, too, after switching to 46f81224e4aae9a05dc7c8e209b4750c014f4d02
. The problem there is that my android/src/main/AndroidManifest.xml
used com.matrixsdk
as the package name (which is what create-react-native-library
had generated for my react-native-matrix-sdk
repository).
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.matrixsdk">
</manifest>
The UBRN-generated code now uses com.reactnativematrixsdk
, however.
Changing the package name in AndroidManifest.xml
fixes things for me. Maybe UBRN should generate this file, too?
Thanks for your analysis!
We have had some difficulty working out what the rules are between Codegen and create-react-native-library
, with #44 being the first attempt.
Unfortunately, I have found this part of the code is very difficult to test!
My latest attempt at has just landed in #72 .
Changing the package name in AndroidManifest.xml fixes things for me. Maybe UBRN should generate this file, too?
Yes, I think this should be regenerated by UBRN.
FWIW: All the templates are in the codegen templates directory. The configuration for those templates, and most of the defaulting rules in the config/mod.rs file.
Unfortunately, I have found this part of the code is very difficult to test!
I also find the name mangling in React Native pretty confusing tbh. As for testing, maybe as an integration test it'd be possible to script the creation of a turbo module using create-react-native-library and UBRN using a dummy Rust crate and then simply run the build? That wouldn't catch runtime errors of course.
I have the following in
package.json
:When generating the turbo module with
46f81224e4aae9a05dc7c8e209b4750c014f4d02
(main branch from an hour ago), the iOS module comes out asNotice how it imports
RNMatrixSdkSpec.h
and tries to implement the eponymous protocol<RNMatrixSdkSpec>
. However, the generated file inexample/ios/build/generated/ios/RNMatrixSdkSpec/RNMatrixSdkSpec.h
defines the protocol as@protocol NativeReactNativeMatrixSdkSpec
. As a result, the build on iOS fails.When I change the name in
package.json
toNativeReactNativeMatrixSdkSpec
both the generated file and the protocol come out as
NativeReactNativeMatrixSdkSpec
and the build succeeds.