2016-02-17 40 views
1

如何從我的react-native項目構建android apk? 這個命令「react-native run-android」在文件夾android \ app \ build \ outputs \ apk \ 上創建app-debug.apk但是當我在手機上安裝它時,出現錯誤「Unable to download JS bundle」 。當我開始在模擬器我第一次使用命令來解決這個問題:如何從我的react-native項目構建android apk?

react-native start curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle" 

回答

2

這一切都寫here

您需要首先生成簽名密鑰,然後將它們設置爲變量,使用它們來配置您的應用程序,然後創建一個簽名的apk。

如果您在此流程的確切點上需要任何幫助,我很樂意爲您提供幫助。但檢查文檔,他們寫得很好。

+1

我做到了,但是當我在我的智能手機上運行這個apk後,apk強行關閉。 – Maksim

+1

檢查[this](http://stackoverflow.com/questions/35406657/react-native-android-application-has-stopped/35413351#35413351) –

+0

非常感謝。 – Maksim

相關問題