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

Cannot open android project in android studio #568

Closed
1 of 2 tasks
GNUGradyn opened this issue Jun 20, 2024 · 3 comments
Closed
1 of 2 tasks

Cannot open android project in android studio #568

GNUGradyn opened this issue Jun 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@GNUGradyn
Copy link

Description

Hello. Upon opening a freshly generated library project in android studio there are a couple issues. I created a library with the options specified in "Selected Options" and ran yarn in the new project. I then attempted to open the android folder within the new library in android studio to work on the native side of things. The first problem you'll encounter is this error when it tries to gradle sync

Could not create task ':generateDebugRFile'.
Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

This is because the AGP version and gradle version are not paired. Go ahead and downgrade gradle to 7.3.3 to get past this. You can also upgrade both if you prefer that route but the result is the same.

Regardless which route you took to get here you will be looking at a screen like this when you open a java file
image
The IDE cannot find anything, even built in things like NonNull.

Packages

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

Selected options

What is the name of the npm package? ... react-native-create-react-native-library-mre
√ What is the description for the package? ... demo for a bug
√ What is the name of package author? ... Gradyn Wursten
√ What is the email address for the package author? ... [email protected]
√ What is the URL for the package author? ... https://github.com/GNUGradyn
√ What is the URL for the repository? ... https://github.com/GNUGradyn/react-native-create-react-native-library-mre
√ What type of library do you want to develop? » Native module
√ Which languages do you want to use? » Java & Swift

Link to repro

https://github.com/GNUGradyn/react-native-create-react-native-library-mre

Environment

System:
OS: Windows 11 10.0.22631
CPU: "(12) x64 AMD Ryzen 5 7600 6-Core Processor "
Memory: 13.22 GB / 31.15 GB
Binaries:
Node:
version: 20.13.1
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 3.6.1
path: C:\Program Files\nodejs\yarn.CMD
npm:
version: 10.5.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio:
- 17.8.34511.84 (Visual Studio Community 2022)
Languages:
Java:
version: 17.0.11
path: /c/Program Files/Common Files/Oracle/Java/javapath/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.2
wanted: 0.74.2
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

It says the android SDK is not found but it is at c:\Android\Sdk which the IDE is aware of so ignore that bit

@GNUGradyn GNUGradyn added the bug Something isn't working label Jun 20, 2024
@satya164
Copy link
Member

I created a library with the options specified in "Selected Options" and ran yarn in the new project. I then attempted to open the android folder within the new library in android studio to work on the native side of things

As mentioned in the generated CONTRIBUTING.md in your project, you need to open the example/android folder in Android Studio.

@GNUGradyn
Copy link
Author

Thanks. Might want to make some mention of this in this repos readme, or at least some mention of the fact directions are in the generated CONTRIBUTING.md

@satya164
Copy link
Member

Thanks. Might want to make some mention of this in this repos readme, or at least some mention of the fact directions are in the generated CONTRIBUTING.md

CONTRIBUTING.md is mentioned in your repo's README, as well as after generating the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants