diff --git a/packages/engine-rn-tvos/templates/platforms/androidtv/settings.gradle b/packages/engine-rn-tvos/templates/platforms/androidtv/settings.gradle index 3462cf789b..8a74c63f4c 100644 --- a/packages/engine-rn-tvos/templates/platforms/androidtv/settings.gradle +++ b/packages/engine-rn-tvos/templates/platforms/androidtv/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = "testRNProject" +rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}' apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}') diff --git a/packages/engine-rn-tvos/templates/platforms/firetv/settings.gradle b/packages/engine-rn-tvos/templates/platforms/firetv/settings.gradle index 3462cf789b..8a74c63f4c 100644 --- a/packages/engine-rn-tvos/templates/platforms/firetv/settings.gradle +++ b/packages/engine-rn-tvos/templates/platforms/firetv/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = "testRNProject" +rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}' apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}') diff --git a/packages/engine-rn/templates/platforms/android/settings.gradle b/packages/engine-rn/templates/platforms/android/settings.gradle index 3462cf789b..8a74c63f4c 100644 --- a/packages/engine-rn/templates/platforms/android/settings.gradle +++ b/packages/engine-rn/templates/platforms/android/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = "testRNProject" +rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}' apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}') diff --git a/packages/engine-rn/templates/platforms/androidwear/settings.gradle b/packages/engine-rn/templates/platforms/androidwear/settings.gradle index 3462cf789b..8a74c63f4c 100644 --- a/packages/engine-rn/templates/platforms/androidwear/settings.gradle +++ b/packages/engine-rn/templates/platforms/androidwear/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = "testRNProject" +rootProject.name = '{{RN_GRADLE_PROJECT_NAME}}' apply from: file("{{RN_CLI_LOCATION}}/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('{{RN_GRADLE_PLUGIN_LOCATION}}') diff --git a/packages/sdk-android/src/deviceManager.ts b/packages/sdk-android/src/deviceManager.ts index 313c739be7..b91a05a83a 100644 --- a/packages/sdk-android/src/deviceManager.ts +++ b/packages/sdk-android/src/deviceManager.ts @@ -55,7 +55,10 @@ export const launchAndroidSimulator = async ( target: true | { name: string } | string, isIndependentThread = false ) => { - logTask('launchAndroidSimulator', `target:${target} independentThread:${!!isIndependentThread}`); + logTask( + 'launchAndroidSimulator', + `target:${typeof target === 'object' ? target?.name : target} independentThread:${!!isIndependentThread}` + ); let newTarget: { name: string } | string; if (target === true) { const { diff --git a/packages/sdk-android/src/gradleParser.ts b/packages/sdk-android/src/gradleParser.ts index 66f7f41865..a3350eb4b6 100644 --- a/packages/sdk-android/src/gradleParser.ts +++ b/packages/sdk-android/src/gradleParser.ts @@ -523,9 +523,9 @@ export const parseSettingsGradleSync = (c: Context) => { const rnCliLocation = doResolve('@react-native-community/cli-platform-android', true, { forceForwardPaths: true }); const rnGradlePluginLocation = doResolve('@react-native/gradle-plugin', true, { forceForwardPaths: true }); - const rnCliRelativePath = (!!rnCliLocation && path.relative(appFolder, rnCliLocation)) || ''; + const rnCliRelativePath = (!!rnCliLocation && path.relative(appFolder, rnCliLocation).replace(/\\/g, '/')) || ''; const rnGradlePluginRelativePath = - (!!rnGradlePluginLocation && path.relative(appFolder, rnGradlePluginLocation)) || ''; + (!!rnGradlePluginLocation && path.relative(appFolder, rnGradlePluginLocation).replace(/\\/g, '/')) || ''; const injects = [ { @@ -544,6 +544,10 @@ export const parseSettingsGradleSync = (c: Context) => { pattern: '{{RN_GRADLE_PLUGIN_LOCATION}}', override: rnGradlePluginRelativePath, }, + { + pattern: '{{RN_GRADLE_PROJECT_NAME}}', + override: c.files.project.config?.projectName.replace('/', '-'), + }, ]; addSystemInjects(c, injects);