Android Studio: doesn't build on simulator after clean install
Asked Answered
M

2

0

How annoying is it that a blank activity doesn't just auto build on a clean Android Studio v1.3 install? I understand needing Java installed for a simulator to run, but the rest is unacceptable..Xcode builds on any device in seconds..

Can someone please explain how this is possible? I mean I've been developing Android apps for years, but this a completely different issue.

No Connected Devices
No Debuggable Application

That's what I get with a brand new install on a Windows 8.1 Parallels VM, with a 4GB partition, actually did drop the simulator's memory to 1GB, because it defaults to a Nexus 5 with 1.5GB needed? That makes no sense if they suggest 512 to 1GB recommended during install...

You understand the question right? How can this happen? Maybe this should be community wiki...

If I was honest with myself, I actually don't know how to fix this out of the box...

UPDATE

Getting

emulator window was out of view and was recentered

and blank emulator screens still after changing:

    minSdkVersion 15
    targetSdkVersion 22

    //to

    minSdkVersion 14
    targetSdkVersion 21

This post doesn't help either...

Mak answered 23/8, 2015 at 4:55 Comment(2)
sometimes the simulator loses connectivity with the adb service - i don't know why i just run with itThalamus
try using genymotionRef
M
0

Well, after messing around with a few things in Project Structure, I starting getting new error related to the JDK. You have to set the JAVA_HOME variable...I was running JDK 6, with 7 and 8 installed. When I tried to change it to 8, there seemed to be more problems than solutions, so I set the JAVA_HOME variable on my Mac by setting the JDK location to the correct location for JDK 7, then used this command in the terminal:

echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile

I've had to do that in the past with Android Studio for Windows, but forgot about all that during setup, since my Mac was defaulting to JDK 6, and my compile version wasn't compatible.

Also, and this is important for other issues I was having...don't run Xcode and Android Studio at the same time inside a Parallels VM? I had the Xcode sim open, which conflicts with HAXM trying to run the emulator. That can lead you down a confusing path that will mislead you to what's really going on.

Mak answered 14/9, 2015 at 18:19 Comment(1)
Who downvotes an answer without a comment? So not what this site is about...I mean, was it something I said? This is what I did in my situation and it's working now, so what's wrong about this solution? I did just make an edit because it said "correct location for JDK 6" instead of "JDK 7" but that's not that big of an error..whatever, so annoying.Mak
K
1

I had the same issue than you but in Windows 7 and in Android Studio v1.1. My Android Studio couldn't auto build a blank activity. I don't know why but changing my minSdkVersion and my targetSdkVersion at build.gradle script to:

minSdkVersion 14
targetSdkVersion 21

It fix my problems and worked perfectly.

I expect your problems will disapear.

Karim answered 23/8, 2015 at 5:8 Comment(1)
didn't seem to work...any thoughts on the fact Android Studio is trying to open an emulator inside of a Parallels VM?Mak
M
0

Well, after messing around with a few things in Project Structure, I starting getting new error related to the JDK. You have to set the JAVA_HOME variable...I was running JDK 6, with 7 and 8 installed. When I tried to change it to 8, there seemed to be more problems than solutions, so I set the JAVA_HOME variable on my Mac by setting the JDK location to the correct location for JDK 7, then used this command in the terminal:

echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile

I've had to do that in the past with Android Studio for Windows, but forgot about all that during setup, since my Mac was defaulting to JDK 6, and my compile version wasn't compatible.

Also, and this is important for other issues I was having...don't run Xcode and Android Studio at the same time inside a Parallels VM? I had the Xcode sim open, which conflicts with HAXM trying to run the emulator. That can lead you down a confusing path that will mislead you to what's really going on.

Mak answered 14/9, 2015 at 18:19 Comment(1)
Who downvotes an answer without a comment? So not what this site is about...I mean, was it something I said? This is what I did in my situation and it's working now, so what's wrong about this solution? I did just make an edit because it said "correct location for JDK 6" instead of "JDK 7" but that's not that big of an error..whatever, so annoying.Mak

© 2022 - 2024 — McMap. All rights reserved.