android_studio使用坑

今天合ZXingLite-master .扫码功能..在AS中导入工程报:

问题一:ERROR: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.6/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap

 

解决步骤:

1、修改项目中gradle.properties文件,只要添加以下一行代码:

org.gradle.jvmargs = -Xmx1536m

改成:

org.gradle.jvmargs = -Xmx1024m

然后Sync project with gradle files(同步一下项目)如图:android_studio使用坑_第1张图片

 

问题二:

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not download core.jar (com.google.zxing:core:3.3.3)
Show Details
Affected Modules: app
 

解决:

先File -> Settings -> Build, Execution, Deployment -> Gradle menu. You will see "Offline work"   勾上,再编一下.报无法下载.

然后显示2个选项,,其中一个是下载....点下载..然后就OK了.下载成功了.

 

你可能感兴趣的:(android_studio使用坑)