Building Android TV app using Android Studio
Closed this issue · 3 comments
Describe the bug
Build using Android Studio (Android Studio Ladybug | 2024.2.1 Patch 3) fails when plugins are added with plugins (e.g. react-native-permissions) the following error:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-permissions:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-permissions:androidJdkImage'.
> Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JdkImageTransform: /Users/yashagarwal/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar.
> Error while executing process /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/jlink with arguments {--module-path /Users/yashagarwal/.gradle/caches/transforms-3/d83a989e8404276f65be3e4101087425/transformed/output/temp/jmod --add-modules java.base --output /Users/yashagarwal/.gradle/caches/transforms-3/d83a989e8404276f65be3e4101087425/transformed/output/jdkImage --disable-plugin system-modules}
To Reproduce
Steps to reproduce the behavior:
- Create new reNative (1.8.0) project using
npx rnv new - Select androidtv, firetv, webos, tizen, kaios as platforms.
- Add react-native-permissions using
npx rnv plugin add - Run the project using
npx rnv run -p androidtvto install all dependencies and verify installation. - Open the app_androidtv project in Android Studio
- After import and syncing is complete, run the project.
Expected behavior
The project should be run identically as with rnv run
Screenshots or copy&paste
Desktop (please complete the following information):
- OS: macOS 15.2 (24C101)
- Node Version: v18.20.7
- RNV Version: v1.8.0
Additional context
Add any other context about the problem here.
@yagarwal thanks for reporting. Want to clear one thing, so after you do
Run the project using npx rnv run -p androidtv to install all dependencies and verify installation.
does the app start in actual emulator? why are you trying to rerun in Android studio?
@pauliusguzas Thanks for your response. I wanted to make sure I retained the ability to run projects from Android Studio as well. That being said, I was able to run the project successfully after downgrading the JDK to 1.7.
@yagarwal thanks for feedback, closing as resolved