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

Fix autolinking bug on Windows #480

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions packages/platform-android/native_modules.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,23 @@ class ReactNativeModules {

def cmdProcess
def root = getReactNativeProjectRoot()
def command = "./node_modules/.bin/react-native config"

def command = "node ./node_modules/react-native/cli.js config"
def reactNativeConfigOutput = ""

try {
cmdProcess = Runtime.getRuntime().exec(command, null, root)
cmdProcess.waitFor()
def inputStreamReader = new InputStreamReader(cmdProcess.getInputStream())
def bufferedReader = new BufferedReader(inputStreamReader)
def line = null
while ((line = bufferedReader.readLine()) != null){
reactNativeConfigOutput += line
}
} catch (Exception exception) {
this.logger.warn("${LOG_PREFIX}${exception.message}")
this.logger.warn("${LOG_PREFIX}Automatic import of native modules failed.")
return reactNativeModules
}

def reactNativeConfigOutput = cmdProcess.in.text
def json = new JsonSlurper().parseText(reactNativeConfigOutput)
this.packageName = json["project"]["android"]["packageName"]
def dependencies = json["dependencies"]
Expand Down