2016-06-29 28 views
1

當我嘗試使用命令'react-native run-android'生成以下錯誤時出現: 錯誤:無法找到或加載主類「Dorg.gradle.daemon =真正的」gradle.daemon react-native:無法找到或加載主類「Dorg.gradle.daemon = true」

JS server already running. 
Building and installing the app on the device (cd android && ./gradlew installDebug... 
Error: Could not find or load main class 「Dorg.gradle.daemon=true」 
Could not install the app on the device, read the error above for details. 

的.bash_profile包含以下全局變量:

export ANDROID_HOME=$HOME/Library/Android/Android-SDK 
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Hom 
export GRADLE_OPTS=「Dorg.gradle.daemon=true」 

我有我的鴯鶓lator正在運行,我運行了命令「source〜/ .bash_profile」。

我只想啓用gradle守護進程並執行項目

+0

不知道這是什麼原因,而應該是:'GRADLE_OPTS =「 - Dorg.gradle.daemon = true」',請記住短劃線「-'。 – Opal

+0

https://docs.gradle.org/current/userguide/gradle_daemon.html#N104AD也聲明瞭這一說法,所以在使用破折號時應該沒問題 –

+0

@Opal非常感謝。我需要「 - 」並刪除「導出」語句。如果你把它寫出來,我將會除了你的伴侶。 – Larney

回答

2

不知道這是什麼原因,但應該是相當:

GRADLE_OPTS="-Dorg.gradle.daemon=true" 

心中幾許-

+0

我可以知道在哪裏編輯該行嗎?我有同樣的問題,但不知道如何解決它。 – Joel

+0

@Joel,這是一個env變量。 – Opal

相關問題