我的安卓手機到哪去了..一拖動那個十字架就報空指針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條經(jīng)驗 獲得超14個贊
compileSdkVersion?23
buildToolsVersion?'26.0.0'
minSdkVersion?25
你這三個參數(shù)有問題啊,Gradle?sync?failed報錯了。至于空指針異常我也不知道那是什么鬼,你先把參數(shù)改對后同步一下,看下有沒有用吧
添加回答
舉報
0/150
提交
取消