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

When create a new module version com.facebook.react:react-native+ not work #446

Closed
1 of 2 tasks
Andersonfrfilho opened this issue Aug 18, 2023 · 5 comments
Closed
1 of 2 tasks
Labels
bug Something isn't working needs-repro

Comments

@Andersonfrfilho
Copy link

Description

When a create a new project, using command: npx create-react-native-library react-name-module
and open project in android studio occour error in get module: com.facebook.react:react-native+,
I try version latest 0.71.0-rc.0 but not work, so try version 0.20.1
to work for me,
this is valid to be corrected ?

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

Need to install the following packages:
create-react-native-library@0.31.1
Ok to proceed? (y) y
√ What is the name of the npm package? ... react-native-sunshine-android
√ What is the description for the package? ... module test chatbot sunshine
√ What is the name of package author? ... Anderson Fernandes
√ What is the email address for the package author? ... andersonfrfilho@gmail.com
√ What is the URL for the package author? ... https://github.com/Andersonfrfilho
√ What is the URL for the repository? ... https://github.com/Andersonfrfilho/react-native-sunshine-android
√ What type of library do you want to develop? » Native module

Link to repro

No response

Environment

info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22621
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 4.03 GB / 15.80 GB
Binaries:
Node:
version: 18.17.1
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 9.6.7
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-223.8836.35.2231.10406996
Visual Studio: Not Found
Languages:
Java: 11.0.20
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

@Andersonfrfilho Andersonfrfilho added the bug Something isn't working label Aug 18, 2023
@atlj
Copy link
Collaborator

atlj commented Aug 24, 2023

Hey, could you provide more details about the steps you took?

Which project have you opened on Android Studio?
What is the full error?
Seems like the steps are not too specific, so could you provide a reproducible repository?

@blabno
Copy link

blabno commented Aug 25, 2023

I'm also having this issue. When you generate the plugin project structure with create-react-native-library and open android folder in Android Studio then it tries to sync gradle project and ends up with the error

Failed to resolve: com.facebook.react:react-native:+

image

Also as you can notice no react native class is detected by AndroidStudio:

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;

All of the above imports are in red.

@atlj
Copy link
Collaborator

atlj commented Aug 25, 2023

Hey @blabno, could you try to open example/android instead of /android on Android Studio? You can see the CONTRIBUTING.md that's generated with your project for details.

@blabno
Copy link

blabno commented Aug 25, 2023

@atlj Interesting, I would never guess that in order to develop the plugin I have to open the example/android, but it works.
Thank you.

@atlj
Copy link
Collaborator

atlj commented Sep 22, 2023

@Andersonfrfilho, assuming my older comment would fix your problem, I'm closing this issue. Please reopen it if it doesn't work for you.

@atlj atlj closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-repro
Projects
None yet
Development

No branches or pull requests

3 participants