Android Studio使用总结

1、新建工程时出现“ERROR :rendering problems The following classes could not be found android.support.v7.internal.widget.ActionBarOverlayLayout”错误
解决办法:

   (1)Either change the api (from preview window pane) from 22 to 21, or
   (2)Change the App Theme from "Project Theme" to any other theme.
   (3)be sure to have imported right appcompat-v7 library in your project structure -> dependencies, Refer these steps: Add the support library feature project identifier to the dependencies section. For example, to include the appcompat project add compile "com.android.support:appcompat-v7:18.0.+" to the dependencies section, as shown in the following example:

	dependencies {
    		...
    	compile "com.android.support:appcompat-v7:18.0.+" }


2、导入工程报Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

   在Android studio下方有正在更新的信息,有一条信息是正在下载的gradle,有版本号,直接去搜索这个版本的gradle下载,下载完成后放到C:\Users\用户名\.gradle\wrapper\dists目录下,注意这个目录与Android studio中Service directory path中的目录(见下图)是一致的,也就是说studio中是什么目录,下载的gradle就放到什么目录,然后在同步或者重启Android studio。这个方法有时候能成功,但有时候也不行,小编现在也不知道为什么,求大神不吝赐教。





3、Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found.

   解决方法:在工程的build.gradle文件的dependencies中添加classpath'com.github.dcendents:android-maven-gradle-plugin:1.5',即下图中划线部分,然后在同步,同步需要的时间很长,耐心等待


   


   android-maven-gradle-plugin与gradle的版本对应关系:

 

   上面的示例总两者的版本是对不上的,需要注意一下,只是做了个例子放在这里

   关于maven的更多知识参考:

   ① https://github.com/dcendents/android-maven-gradle-plugin

   ② https://github.com/simpligility/android-maven-plugin

   ③ http://www.xyczero.com/blog/article/19/


4、Error:(2, 0) No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices. <

   点击open file 会跳转到apply plugin: ‘com.github.dcendents.android-maven’这行,要解决这个问题只需要去将工程的build.gradle文件中的依赖版本更新一下,然后在同步就行了,如下图

   

   将划线部分后面的版本号换乘高一点的版本然后再同步即可


5.启动时弹窗 Unable to create Debug Bridge:Unable to start adb server,或者选择调试设备是找不到设备

使用 netstat -aon|findstr “5037”命令查看占用端口进程的pid,5037是android studio所需的端口,启动时在弹窗可以看到需要的端口,然后使用tasklist /pid “查出的pid” /f命令强制关闭进程即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值