Android studio各种问题

突然手机连接不上了,暂时用模拟机测试:

1.之前用genymotion,安装插件后出现无法启动,卸载了,未进行第二次尝试;

2.新建模拟机,测试:

HAX is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD      RAM size = 1024 MB
emulator: HAXM max RAM size = 512 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.

启动时出现以上问题,说明是建立时分配虚拟内存过大,超过HAXM内存,所以在建立时需要注意,或此处重新更改,即可,启动成功,很慢,手机连接上还是不用这个;


3.新建工程,版本不一致

Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

是由于app下build.gradle的

compile 'com.android.support:appcompat-v7:23.0.0'版本更新导致;可升级或更改版本(用可用的)


 

Gradle DSL method not found: 'android()


原文错误提示:

Error:(16, 0) Gradle DSL method not found: 'android()'
Possible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>


错误原因:

android studio 引进项目时,自动查找本机是否有项目设置的SDK版本,若发现没有,我们会在project structure修改成自己的SDK。然而,修改后,AS会自动在项目下的build.gradle里添加上以下代码:



解决办法:

删除以上图片中红框中的代码,然后再执行build->Rebuild project,删除完之后的代码如下:



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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值