From c3f4d79475ac0cf14027e862043a8f4eda93dc04 Mon Sep 17 00:00:00 2001 From: Gant Date: Fri, 8 Jul 2016 01:33:51 -0700 Subject: [PATCH] changes link file on Android to MainApplication.java for 0.29 update Summary: rnpm aka `react-native link` is broken with Android 0.29 - #8603 This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed. Closes https://github.com/facebook/react-native/pull/8612 Differential Revision: D3533960 fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55 --- local-cli/rnpm/core/src/config/android/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/local-cli/rnpm/core/src/config/android/index.js b/local-cli/rnpm/core/src/config/android/index.js index f8277307f..295b3b7d3 100644 --- a/local-cli/rnpm/core/src/config/android/index.js +++ b/local-cli/rnpm/core/src/config/android/index.js @@ -33,9 +33,9 @@ exports.projectConfig = function projectConfigAndroid(folder, userConfig) { const packageFolder = userConfig.packageFolder || packageName.replace(/\./g, path.sep); - const mainActivityPath = path.join( + const mainFilePath = path.join( sourceDir, - userConfig.mainActivityPath || `src/main/java/${packageFolder}/MainActivity.java` + userConfig.mainFilePath || `src/main/java/${packageFolder}/MainApplication.java` ); const stringsPath = path.join( @@ -68,7 +68,7 @@ exports.projectConfig = function projectConfigAndroid(folder, userConfig) { buildGradlePath, settingsGradlePath, assetsPath, - mainActivityPath, + mainFilePath, }; };