[英]Android studio gradle build running for too long time for build apk
Please help me friends. 请帮帮我的朋友。 There is no error in code.
代码中没有错误。 When I use Instant Run app opens perfectly on device but I cannot extract that apk to test on other device.
当我使用Instant Run应用程序在设备上完美打开但我无法提取该apk以在其他设备上进行测试。
You need to disable Instant Run first, because debug apk built with Instant Run will not run on phone with different api level from your test device. 您需要先禁用“ 即时运行” ,因为使用“即时运行”构建的调试apk无法在测试设备上具有不同api级别的手机上运行。
Then you need to clean up and build the apk. 然后你需要清理并构建apk。 If building apk seems like forever, make sure your internet connection is up.
如果构建apk似乎永远,请确保您的互联网连接已启动。
To Fix this Issue no need to enable gradle online mode. 要解决此问题,无需启用gradle在线模式。 I just cleaned Project and done rebuild.
我刚刚清理了Project并完成了重建。 Then restarted Android studio.
然后重启Android工作室。 Now it's build apk very fast.
现在它构建apk非常快。 It's recommend to enable gradle offline mode (not for initial build and when importing new libs)
建议启用gradle offline模式(不适用于初始构建和导入新库时)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.