Closed e-shami closed 6 days ago
Same issue
@kishanshettyb I resolved this problem to be able to create a prebuild and run the project without any error on android by creating a file in the root folder name 'withJvmTargets.js' with the following content in it:
const { withProjectBuildGradle, withAppBuildGradle } = require('@expo/config-plugins');
function withJvmTarget(config) {
// Apply changes to the root project build.gradle
config = withProjectBuildGradle(config, config => {
if (config.modResults.contents) {
// Ensure global Kotlin JVM target compatibility
config.modResults.contents += allprojects { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { jvmTarget = "17" } } }
;
}
return config;
});
// Apply changes to the app build.gradle
config = withAppBuildGradle(config, config => {
if (config.modResults.contents) {
// Ensure Java toolchain is set
config.modResults.contents += java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } }
;
}
return config;
});
return config; }
module.exports = withJvmTarget;
next, I added this file into the plugins section of app.json as follow:
after this, I was able to create a prebuild, or a dev build using eas, and run the app on local server, but there is still an issue, while using the package, I get an error related to the 'HBRecorder' of the native implementation of the package. Please try these steps on your side and confirm if you get the same 'next-problem' or this works for you completely.
I have fixed this issue and created a pull request with the changes in a fork I did. Hope this helps for everyone trying to use the screen recording functionality.
@e-shami Thank you for the pull request! I’ll check it out to see if it resolves the issue.
In an new expo project with nothing else installed except this package, and the plugin you mentioned in the readme.md, when I create a prebuild and then use npx expo run:android to launch the prebuild on a pixel 6 pro emulator for android. I tried the same process on a simulator on mac to run on a simulator for iPhone 13 pro, it worked fine. I have attached the snapshot of the error on android below: