简体   繁体   English

如何创建离线Android应用程序开发环境

[英]How to create offline Android apps development environment

I'm trying to create my android apps development environment.我正在尝试创建我的 android 应用程序开发环境。 Now already installed the Android Studio(with SDK) and JDK.现在已经安装了Android Studio(带SDK)和JDK。 but when I'm trying to create my first apps, the Android studio is trying to get several dependencies from website.但是当我尝试创建我的第一个应用程序时,Android 工作室正在尝试从网站获取多个依赖项。 I don't have internet connection on the development PC, is there any way to download the dependencies to local and setup an offline enviroment?我在开发 PC 上没有互联网连接,有什么方法可以将依赖项下载到本地并设置离线环境?

below are the error messages while I'm trying to build my first project.以下是我尝试构建我的第一个项目时的错误消息。 A problem occurred configuring project ':app'.配置项目“:app”时出现问题。

Could not resolve all dependencies for configuration ':app:_debugAndroidTestApkCopy'.无法解析配置“:app:_debugAndroidTestApkCopy”的所有依赖项。 Could not resolve com.squareup:javawriter:2.1.1.无法解析 com.squareup:javawriter:2.1.1。 Required by: MyApplication2:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2 Could not resolve com.squareup:javawriter:2.1.1.需要:MyApplication2:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.2 无法解析 com.squareup:javawriter:2.1.1。 Could not get resource ' https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom '.无法获取资源“ https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom ”。 Could not GET ' https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom '.无法获取“ https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom ”。

You can copy those dependencies to your .m2 directory and refer to that directory using below repositories { mavenLocal() }您可以将这些依赖项复制到您的 .m2 目录并使用以下repositories { mavenLocal() }引用该目录repositories { mavenLocal() }

and set gradle to offline mode.并将 gradle 设置为离线模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM