【问题标题】:React-native run-android take too much timeReact-native run-android 花费太多时间
【发布时间】:2017-04-27 11:31:17
【问题描述】:

我在 Windows 上使用 react-native 已经 2 周了。但是现在,在我的设备上运行我的应用程序需要太多时间。

Scanning 835 folders for symlinks in D:\workspace\react-
native\MonCompte\node_modules (31ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat 
installDebug)...
> Configuring > 3/5 projects > Resolving dependencies ':app:_debugApk' > 
Resolving dependencies ':react-native-vector-icons:_releaseCompile'

此时它似乎“冻结”了。 25 多分钟后,它终于构建了!

请问有人有想法吗?谢谢 !

【问题讨论】:

  • 你的电脑配置是什么?
  • i5-6500 3.20Ghz / 8Go RAM / Windows 10。但昨天运行不到 1 分钟
  • 尝试清理守望者缓存。 watchman watch-del-all
  • Windows 没有守望者。 (有一个 alpha 我试过这个但它不起作用)
  • 有什么想法吗?我仍然没有找到解决方案。

标签: android windows react-native


【解决方案1】:

所以我终于找到了解决办法。

这是因为我的代理不在 gradle.properties 文件中!

systemProp.http.proxyHost=http://myproxy.proxy
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=http://myproxy.proxy
systemProp.https.proxyPort=8080

【讨论】:

  • 可以在linux上应用同样的解决方案吗
  • 如何以及在哪里应用这个?
【解决方案2】:

确保android/build.gradle 中不包含这些行:

maven { url 'https://dl.bintray.com/android/android-tools' }
maven { url 'https://dl.bintray.com/firebase/gradle/' }

如果确实包含它们,则删除或简单地将这些行注释掉。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多