Open CodeWithBlaze opened 3 weeks ago
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.76.1. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
@CodeWithBlaze can you share your full build log?
@cortinico Thank you for adressing the issue so quickly sure i can provide build logs
> TurboModuleExample@0.0.1 start
> react-native start
info Welcome to React Native v0.76
info Starting dev server on port 8081...
▒▒▓▓▓▓▒▒
▒▓▓▓▒▒░░▒▒▓▓▓▒
▒▓▓▓▓░░░▒▒▒▒░░░▓▓▓▓▒
▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓
▓▓░░░░░▒▓▓▓▓▓▓▒░░░░░▓▓
▓▓░░▓▓▒░░░▒▒░░░▒▓▒░░▓▓
▓▓░░▓▓▓▓▓▒▒▒▒▓▓▓▓▒░░▓▓
▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓▓
▓▓▒░░▒▒▓▓▓▓▓▓▓▓▒░░░▒▓▓
▒▓▓▓▒░░░▒▓▓▒░░░▒▓▓▓▒
▒▓▓▓▒░░░░▒▓▓▓▒
▒▒▓▓▓▓▒▒
Welcome to Metro v0.81.0
Fast - Scalable - Integrated
info Dev server ready
i - run on iOS
a - run on Android
r - reload app
d - open Dev Menu
j - open DevTools
info Opening app on Android...
info A dev server is already running for this project on port 8081.
info Installing the app...
> Task :gradle-plugin:settings-plugin:checkKotlinGradlePluginConfigurationErrors
> Task :gradle-plugin:shared:checkKotlinGradlePluginConfigurationErrors
> Task :gradle-plugin:shared:compileKotlin UP-TO-DATE
> Task :gradle-plugin:shared:compileJava NO-SOURCE
> Task :gradle-plugin:shared:processResources NO-SOURCE
> Task :gradle-plugin:shared:classes UP-TO-DATE
> Task :gradle-plugin:shared:jar UP-TO-DATE
> Task :gradle-plugin:settings-plugin:compileKotlin UP-TO-DATE
> Task :gradle-plugin:settings-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:settings-plugin:pluginDescriptors UP-TO-DATE
> Task :gradle-plugin:settings-plugin:processResources UP-TO-DATE
> Task :gradle-plugin:settings-plugin:classes UP-TO-DATE
> Task :gradle-plugin:settings-plugin:jar UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:checkKotlinGradlePluginConfigurationErrors
> Task :gradle-plugin:react-native-gradle-plugin:compileKotlin UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:react-native-gradle-plugin:pluginDescriptors UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:processResources UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:classes UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:jar UP-TO-DATE
> Task :app:checkKotlinGradlePluginConfigurationErrors
> Task :app:generateAutolinkingNewArchitectureFiles UP-TO-DATE
> Task :app:generateAutolinkingPackageList UP-TO-DATE
> Task :app:generateCodegenSchemaFromJavaScript UP-TO-DATE
> Task :app:generateCodegenArtifactsFromSchema UP-TO-DATE
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:packageDebugResources UP-TO-DATE
> Task :app:parseDebugLocalResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugManifestForPackage UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:compileDebugKotlin UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:compressDebugAssets UP-TO-DATE
> Task :app:desugarDebugFileDependencies UP-TO-DATE
> Task :app:dexBuilderDebug UP-TO-DATE
> Task :app:mergeDebugGlobalSynthetics UP-TO-DATE
> Task :app:processDebugJavaRes UP-TO-DATE
> Task :app:mergeDebugJavaResource UP-TO-DATE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:mergeExtDexDebug UP-TO-DATE
> Task :app:mergeLibDexDebug UP-TO-DATE
> Task :app:mergeProjectDexDebug UP-TO-DATE
> Task :app:configureCMakeDebug[arm64-v8a]
> Task :app:buildCMakeDebug[arm64-v8a]
> Task :app:configureCMakeDebug[armeabi-v7a]
> Task :app:buildCMakeDebug[armeabi-v7a]
> Task :app:configureCMakeDebug[x86]
> Task :app:buildCMakeDebug[x86]
> Task :app:configureCMakeDebug[x86_64]
> Task :app:buildCMakeDebug[x86_64]
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :app:mergeDebugNativeLibs UP-TO-DATE
> Task :app:stripDebugDebugSymbols UP-TO-DATE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:writeDebugAppMetadata UP-TO-DATE
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE
> Task :app:packageDebug UP-TO-DATE
> Task :app:createDebugApkListingFileRedirect UP-TO-DATE
> Task :app:installDebug
Installing APK 'app-debug.apk' on 'RMX3771 - 14' for :app:debug
Installed on 1 device.
BUILD SUCCESSFUL in 25s
64 actionable tasks: 13 executed, 51 up-to-date
info Connecting to the development server...
info Starting the app on "5XAIKRCAZX9XBEEY"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.turbomoduleexample/.MainActivity }
BUNDLE ./index.js
Let me know if you need something else, since the bug is in developement so i provided the build logs for debug build.
Just tested your reproducer and it works fine on my machine:
https://github.com/user-attachments/assets/bdb19b0c-1c36-423f-948f-b62e8519c071
Do you happen to have any spaces in the full path of your project (like in any of the parent folders also)?
No there is no space in the full path of my project. Also I would request you to test it on android 14 the video shows API 32 which is Android 12 so can you please try on android 14. Also this is happening in windows for me, i am not sure of mac
Also I would request you to test it on android 14 the video shows API 32 which is Android 12 so can you please try on android 14
Same, cannot reproduce:
https://github.com/user-attachments/assets/edc40760-4ccd-448b-a1e8-512f7d59687b
i guess then it is a windows specific issue because i tried it on three diff project and same happened for all of them. I will test it on a diff system and will update you soon. if the error persist then we can keep this open or else it will my my device specific problem so will close this issue then.
Hey @cortinico i have tested it in a seperate windows device (installed everything from scratch even the SDK) and the issue is still there. I do not have a mac to test on but it seems the error is popping up in windows system.
can anyone verify this by testing a brand new app on a windows machine. I have already tested it in 2 device. @cortinico is it possible for you to test in a windows environment ?
@CodeWithBlaze I tested same on Windows, and I have same issue.
@cortinico What do you think? How can this issue could be mitigated?
@cavadibrahimli1 just wanted to know did you create your own native turbo module or this happened when you installed something
@CodeWithBlaze I just follow the tutorial on the React's official website below:
I did everything related to android side. It finished its build successfully. What about you?
@cavadibrahimli1 I followed this exactly Tutorial
My main goal is just running one cpp code in my app. But I think, this issue is all about a bug @CodeWithBlaze
Hey @CodeWithBlaze,
Can you show me the full path of your project and if it has any whitespaces?
@migueldaipre This is the fullpath to my project D:\poc\TurboModuleExample
can anyone verify this by testing a brand new app on a windows machine. I have already tested it in 2 device.
I also tested it on a Windows machine and I cannot reproduce:
https://github.com/user-attachments/assets/f45a47f9-0561-4b01-ab17-1de4a12b014c
@cortinico thank you so much for testing it on windows. I will do a test using yarn and powershell from my side. Like I have no clue why is it not working on my system. But appreciate your help
@CodeWithBlaze can you share info about after testing it via yarn and on powershell
I am outside of my home for 2 days so need some time before I can provide you the info. Sorry for the inconvenience
@CodeWithBlaze can you just mention me, when you solved or tried this?
@cavadibrahimli1 I didn't solved it yet neither tried with yarn and powershell. I am out of home, once I reach home then I will try and update here.
@CodeWithBlaze I tried with yarn install - yarn start . It gave the same ERROR output
@cavadibrahimli1 I am not sure man why this is happening. Like personally yarn and npm both are package managers and powershell and cmd both are terminals so logically testing on them for diff result doesn't make sense at all but this is currently the best shot I got.
Hey Guys, i tested it using yarn and powershell and it worked. What i did is here
1) I deleted the node_modules 2) then i installed yarn using npm install --global yarn 3) then i tried yarn install in the project (in powershell) and i got this error
yarn : File C:\Users\sagni\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this system.
For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn install
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
4) I solved it by finding this Solution 5) then simply yarn install 6) cd android 7) ./gradlew generateCodegenArtifactsFromSchema 8) cd .. 9) yarn android it worked. what i think is that npm failed to link the new lib whereas yarn did it properly. Not sure why this worked but just guessing and hope that it works for all of you.
Thank you @cortinico for helping out so much in this issue. Let me know if i can help you out in any way (although i don't know much android)
- then i installed yarn using npm install --global yarn
Sir, did you use npm install -global yarn command in the root directory of your project?
@cavadibrahimli1 Bro firstly no sir, friend or bro works 😁. Second dosen't matter where you run this command as yarn will be installed globally and will be available in all projects. But just to answer your question yes, I ran it in my project directory using cmd in administrator mode.
I did the same thing you mentioned. @CodeWithBlaze , but it didn't worked for me
The error I got is
@cavadibrahimli1 I think your problem is diff than mine and mostly related to this Issue. Please check this out once. Let me know the result so that I can decide on whether to close this issue or not. Most probably it is due to the case that you are passing your own CMake file overriding the original
@cortinico or @migueldaipre can you please tell me how to add multiple turbo modules in the codegen config in package.json. This is not mention in the docs ?
我也是类似的解决方法:
npx react-native run-android
编译了 react native template,之后编写了 turbo 模块后 使用 yarn react-native run-android
进行编译,会报错查询不到 turbo module;yarn react-native clean
,选择 android build cache,之后再使用 yarn react-native run-android
进行编译就可以查询到 turbo 模块了I have used yarn to re
我也是类似的解决方法:
- win11 下使用
npx react-native run-android
编译了 react native template,之后编写了 turbo 模块后 使用yarn react-native run-android
进行编译,会报错查询不到 turbo module;- 执行
yarn react-native clean
,选择 android build cache,之后再使用yarn react-native run-android
进行编译就可以查询到 turbo 模块了
I have used yarn to re-install node_modules and run , then it worded,
Here is my understanding on this and following this should solve it for all cases
jsSrcsDir
with any files whose name starts with "Native"."android": { "javaPackageName": "com.anynameyouwant" }
this line specifies the codegen output package for all of your turbo modules. basically the specs it has generated will be stored here
NativeLocalStorageModule.java
) for each of the turbo module or a single file for all of them. So currently i can confirm that for each turbo module if you create one module file it will work. NativeLocalStoragePackage.java
). not sure to create a single file or multiple file but mutliple file works (one for each turbo module)MainApplication.java
like this
packages.add(new FirstPackage());
package.add(new SecondPackage());
and so on (FirstPackage and SecondPackage names are just for ref.
Replace them with your own package name) I hope it helps Also if anyone can confirm point 4 and point 5 that will be great. thnx
我可以补充一点:
jsSrcsDir
中的所有名称以 “Native” 开头的规范文件(NativeLocalStorage.ts
),并根据规范文件生成原生的接口文件javaPackageName
的包中,类名是根据规范文件的名称加上 Spec
后缀(NativeLocalStorageSpec.java
)i found that enforcing I've encountered a strange issue. I wrote a C++ turbo module and created a lib. It worked perfectly when I used the function
export default TurboModuleRegistry.getEnforcing<Spec>('NativeCrypto');
in version 0.76.1.
However, after upgrading to versions 0.76.2 and 0.76.3, and after excluding the issue with the Windows packaging CMake path, using getEnforcing gives the error: EarlyJsError: TurboModuleRegistry.getEnforcing(...) [module name] could not be found. Verify that a module by this name is registered in the native binary. Interestingly, when I change the export of the problematic NativeCrypto module to get, it works fine again. This is very strange.
Description
When created a Turbo Module with exact same steps as mention in React Native Official Docs, the app builds but then shows the error EarlyJsError: TurboModuleRegistry.getEnforcing(...) [module name] could not be found. Verify that a module by this name registered in the native binary.
Note: Platform is windows 11 (the react native app folder is already in exclusion from windows defender) Running on a physical device : Realme 11 pro 5g (Android 14) mode: developement
Steps to reproduce
1) git clone https://github.com/CodeWithBlaze/TurboModuleExampleWIthError 2) npm install 3) npm run android
React Native Version
0.76.0
Affected Platforms
Runtime - Android
Areas
TurboModule - The New Native Module System
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/CodeWithBlaze/TurboModuleExampleWIthError
Screenshots and Videos