为了账号安全,请及时绑定邮箱和手机立即绑定

安卓Studio初次使用

安卓Studio初次使用

暴躁的代码 2017-07-16 00:08:09
我的安卓手机到哪去了..一拖动那个十字架就报空指针null java.lang.NullPointerException at com.android.tools.idea.uibuilder.surface.CanvasResizeInteraction.<init>(CanvasResizeInteraction.java:103) at com.android.tools.idea.uibuilder.surface.InteractionManager$Listener.mousePressed(InteractionManager.java:446) at java.awt.Component.processMouseEvent(Component.java:6530) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)Gradle sync failed: Could not find method android() for arguments [build_f2uiel5fv19yxv4mzot8n06jd$_run_closure3@6d1da161] on root project 'HelloWorld' of type org.gradle.api.Project. Consult IDE log for more details (Help | Show Log)这是buider.gradle文件// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:2.3.3'         // NOTE: Do not place your application dependencies here; they belong         // in the individual module build.gradle files     } } allprojects {     repositories {         jcenter()     } } task clean(type: Delete) {     delete rootProject.buildDir } android {     signingConfigs {     }     compileSdkVersion 23     buildToolsVersion '26.0.0'     dexOptions {         incremental true     }     compileOptions {         sourceCompatibility JavaVersion.VERSION_1_7         targetCompatibility JavaVersion.VERSION_1_7     }     defaultConfig {         minSdkVersion 25     }     productFlavors {     } } dependencies { }
查看完整描述

3 回答

?
为梦想努力_冬

TA贡献56条经验 获得超14个赞

compileSdkVersion 23

buildToolsVersion '26.0.0'

minSdkVersion 25

你这三个参数有问题啊,Gradle sync failed报错了。至于空指针异常我也不知道那是什么鬼,你先把参数改对后同步一下,看下有没有用吧

查看完整回答
反对 回复 2017-07-17
  • 3 回答
  • 0 关注
  • 2877 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信