I recently downloaded the newest Android Studio 1.0 release and immediately began going through hell to try to get a new project up and running. I created a new Maps Project and as soon as I go to run, it gives me the following:
Waiting for device.
Target device: motorola-xt1063-ZX1D3226RL
Uploading file
local path: C:\Users\Rich\Desktop\WebProjects\AndroidStudioProjects\BlocWork\BlocSpot\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.richluick.blocspot
Local path doesn't exist.
Now, I realize that there are similar questions out there, but nothing I try is working. I updated the .iml file like most people have suggested:
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="APK_PATH" value="/build/apk/blocspot-debug-unaligned.apk" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
That isnt working for me. As others also sugested I tried the gradlew clean packagedebug --debug command and got the following:
14:34:14.187 [ERROR] [org.gradle.BuildExceptionReporter]
14:34:14.190 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:34:14.198 [ERROR] [org.gradle.BuildExceptionReporter]
14:34:14.200 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
14:34:14.202 [ERROR] [org.gradle.BuildExceptionReporter] java.lang.NullPointerException (no error message)
14:34:14.204 [ERROR] [org.gradle.BuildExceptionReporter]
14:34:14.207 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:34:14.210 [ERROR] [org.gradle.BuildExceptionReporter] java.lang.NullPointerException
I have no understanding as to why or how a Null Pointer Exception is being thrown when compiling he gradle. I have been working on this for hours and I just cannot get this to work. I hope somebody can help me with this. The stacktrace from the error is below.
14:34:14.212 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.internal.compiler.PreDexCache.createItemNode(PreDexCache.java:189)
14:34:14.214 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.internal.compiler.PreDexCache.createItemNode(PreDexCache.java:60)
14:34:14.216 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.internal.compiler.PreProcessCache.saveItems(PreProcessCache.java:486)
14:34:14.218 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.internal.compiler.PreProcessCache.clear(PreProcessCache.java:375)
14:34:14.220 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.builder.internal.compiler.PreProcessCache$clear$0.call(Unknown Source)
14:34:14.222 [ERROR] [org.gradle.BuildExceptionReporter] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
14:34:14.224 [ERROR] [org.gradle.BuildExceptionReporter] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
14:34:14.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
14:34:14.229 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.BasePlugin$_configureProject_closure1.doCall(BasePlugin.groovy:318)
14:34:14.231 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:34:14.232 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:34:14.234 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:34:14.236 [ERROR] [org.gradle.BuildExceptionReporter] at java.lang.reflect.Method.invoke(Method.java:483)
14:34:14.237 [ERROR] [org.gradle.BuildExceptionReporter] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
14:34:14.239 [ERROR] [org.gradle.BuildExceptionReporter] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
14:34:14.241 [ERROR] [org.gradle.BuildExceptionReporter] at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278)
14:34:14.243 [ERROR] [org.gradle.BuildExceptionReporter] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
14:34:14.245 [ERROR] [org.gradle.BuildExceptionReporter] at groovy.lang.Closure.call(Closure.java:423)
14:34:14.246 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
14:34:14.248 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
14:34:14.250 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
14:34:14.251 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
14:34:14.254 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
14:34:14.257 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.proxy.$Proxy12.buildFinished(Unknown Source)
14:34:14.259 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:111)
14:34:14.262 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
14:34:14.264 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
14:34:14.268 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
14:34:14.270 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
14:34:14.272 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
14:34:14.276 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
14:34:14.281 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
14:34:14.284 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
14:34:14.287 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
14:34:14.289 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
14:34:14.291 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
14:34:14.293 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
14:34:14.346 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
14:34:14.348 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
14:34:14.351 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
14:34:14.353 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
14:34:14.356 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:33)
14:34:14.576 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
14:34:14.578 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:34:14.581 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:34:14.583 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:34:14.631 [ERROR] [org.gradle.BuildExceptionReporter] at java.lang.reflect.Method.invoke(Method.java:483)
14:34:14.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
14:34:14.636 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
14:34:14.649 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
14:34:14.651 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:34:14.653 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:34:14.655 [ERROR] [org.gradle.BuildExceptionReporter] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:34:14.657 [ERROR] [org.gradle.BuildExceptionReporter] at java.lang.reflect.Method.invoke(Method.java:483)
14:34:14.659 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
14:34:14.661 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
14:34:14.664 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
14:34:14.669 [ERROR] [org.gradle.BuildExceptionReporter]
This is how I solved it:
In application's build.gradle file make sure gradle version is atleast 1.1.0 like this:
classpath 'com.android.tools.build:gradle:1.1.0'
and the repositories section contains mavenCentral() instead of jCentral()
Try the following:
If all else fails, revert to v.0.9.3 found on the Canary channel. Hopefully Google sorts out the issue sooner rather than later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With