Issues after updating to Android Studio 2.0v

In this post, I just like to sum up all the issues faced after updating Android version.

After updating to Android Studio 2.0v, you may see following issues.

You’ll be asked to install latest gradle version to enable Instant Run. you think it helps and installs the latest Gradle version.

Now, your problems starts You may be able build project. But couldn’t able to run the project. When you run the project, you’ll see Out of memory exception as below. 😐

Error:java.lang.OutOfMemoryError: Java heap space.
Please assign more memory to Gradle in the project's file.
For example, the following line, in the file, sets the maximum Java heap size to 1,024 MB:
<a href="">Read Gradle's configuration guide</a><br><a href="">Read about Java's heap size</a>

I tried different ways to increase the memory, like changing the memory values in file

org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m

and changing values in studio64.exe.vmoptions file in C:\Program Files\Android\Android Studio\bin folder


but not worked. 🙁

The only thing that worked for me is adding javaMaxHeapSize value of dexOptions in app’s build.gradle file.

  dexOptions {
     javaMaxHeapSize "2g"

this fixes the OutOfMemoryError issue. The reason for this issue is the latest version gradle needs more memory to build the app.

And after fixing You may see Multiple dex files issue. For me I get this error

Cause: Multiple dex files define Lcom/google/zxing/BarcodeFormat;  😮

I tried following to fix this issue

defaultConfig {
// Enabling multidex support.
multiDexEnabled true

Which resulted same issue in different way 😡

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> duplicate entry: com/google/zxing/BarcodeFormat.class

in inconsistent location 'C:\Users\employee2\AppData\Local\Android\sdk\add-ons\addon-google_apis-google-19-1'
(Expected 'C:\Users\employee2\AppData\Local\Android\sdk\add-ons\addon-google_apis-google-19')

Error:Error converting bytecode to dex:

So, I removed that multiDexEnabled true line and search for the BarcodeFormat class usage in project. I finally find out that same dependencies library added in module’s and app’s  build.gradle file. I just commented dependencies library in app’s build.gradle file fixed the issue.  😎

So, finally After fixing all issues and you’ll be able to run the app. 

And then, now you made some code changes and run the app. App won’t run on device with latest code changes. In the Android Studio Run tab you’ll see “No changes”.  What! 😮

The reason for this Instant Run not recognizes certain code changes, and it also needs latest android API.


So, the only option to see your code changes effect in app and run on device, is disable Instant Run. Please see following image to disable

after updating

That’s it now you able to see code changes by running the app on device.  😎


Hope it saves somebodies time. 💡


You may also interested in


Leave a Reply

Your email address will not be published. Required fields are marked *