Help required in setting up Android Studio

AI Thread Summary
The discussion revolves around troubleshooting issues with Android Studio setup, specifically related to Gradle build errors. The user has set up Android Studio on a 32-bit computer, with the SDK on the G: drive and the IDE on the C: drive, following a tutorial book. Despite creating a project with specified SDK versions, they encounter persistent build errors. Key points include the difficulty in parsing error messages and the possibility of outdated libraries or incorrect configurations. The user expresses a desire to stick with Android Studio due to the tutorial's structure, which requires using this IDE. A significant breakthrough occurs when it is discovered that the issue was related to using a deprecated JDK version, which prevented the Gradle build from starting properly. After updating the JDK, the build process is resolved, highlighting the importance of ensuring compatibility between the IDE and the Java version being used.
Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,717
This is the fifth time I am setting up Android Studio. I have downloaded the standalone zip for 32 bit computer from the official website. The android SDK is in G: drive, while the Android Studio files are in C:.

I have set up Android Studio, and set the SDK location to the required folder in G:. I have created a project with minSDK as API 15, and compileSDK and target SDK are both API 23. I have doneall this with instructions from this book: "The Busy Coder's Guide to Android Development" by Mark L. Murphy.

I am facing the same problem as the last time. It's saying that gradle build has finished with errors:

android studio problem.JPG

Android Studio problem #2.JPG


Can anyone please help me out?
 

Attachments

  • android studio problem.JPG
    android studio problem.JPG
    51.5 KB · Views: 615
  • Android Studio problem #2.JPG
    Android Studio problem #2.JPG
    52 KB · Views: 533
Technology news on Phys.org
When a software package gives trouble I sometime switch packages. Have you tried the Atom editor with PlatformIO. Atom is a great general purpose coding editor. The PlatformIO (a free Atom package) has worked well programming my Uno. It's free and I've had good luck with it. It's also available on Mac OS and Linux.
 
Paul Colby said:
When a software package gives trouble I sometime switch packages. Have you tried the Atom editor with PlatformIO. Atom is a great general purpose coding editor. The PlatformIO (a free Atom package) has worked well programming my Uno. It's free and I've had good luck with it. It's also available on Mac OS and Linux.
I would have happily tried out other platforms, but I can't. The reason is, the book I'm following, is like a tutorial, and after explaining topics, it asks the readers to try out the example codes. At the end of the book, one will have developed an application called EmPubLite. The IDE used throughout the book is Android Studio. Since I'm a first time learner, I want to follow the book strictly before playing with other IDEs.
 
  • Like
Likes BvU
Wrichik Basu said:
I would have happily tried out other platforms, but I can't. The reason is, the book I'm following, is like a tutorial, and after explaining topics, it asks the readers to try out the example codes.

Yeah, I hate when that happens. The problem you face is parsing and understanding the error messages you are given. So, you have to debug either your setup, or the tutorial. Tutorials go stale with time because IDEs aren't static, they get "improved" as do the libraries for the device being programmed. If it's compiling with errors, my guess (and it's just a guess) are some libs are wrong versions or something. I'd need to see the error messages to even hope to help.
 
  • Like
Likes BvU
Paul Colby said:
Yeah, I hate when that happens. The problem you face is parsing and understanding the error messages you are given. So, you have to debug either your setup, or the tutorial. Tutorials go stale with time because IDEs aren't static, they get "improved" as do the libraries for the device being programmed. If it's compiling with errors, my guess (and it's just a guess) are some libs are wrong versions or something. I'd need to see the error messages to even hope to help.
I didn't even write a line of code. I created the project, and from that time, it's showing that there was an error in building the project, while the book says that it should compile properly.

I can provide the error messages if you tell me how to find them.
 
I see, code could not reserve enough for the huge object space. Why the huge object?
 
So, if you didn't write any code, what is being compiled?
 
Paul Colby said:
So, if you didn't write any code, what is being compiled?
There is some code that is written by default when a project is made. Was I wrong to compile that code?
 
Wrichik Basu said:
There is some code that is written by default when a project is made. Was I wrong to compile that code?
There is no wrong, there is only working or not working. Looking at the code the include *.jar line looks like it could load a pot load of stuff. Is your file tree too big. (Warning I hate windows and don't use it and have never touched an android device, ever.)
 
  • #10
Okay, maybe your library include file path isn't setup right?
 
  • #11
Paul Colby said:
Okay, maybe your library include file path isn't setup right?
I think so. I just found this:



Let me see if that works.
 
  • #12
Nope. It is not working.

I'm getting this error:

Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.7/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 1048576KB object heap
 
  • #13
You mention G: disk etc. Are you certain Android Studio plays well with that location. Try a folder on C:?
 
  • #14
Paul Colby said:
You mention G: disk etc. Are you certain Android Studio plays well with that location. Try a folder on C:?
It's not a problem with the SDK. The problem is with the gradle, and that is present in the folder of Android Studio in C: drive. Somehow the IDE is unable to sync with the gradle, even though necessities like Internet are available throughout the process. Command prompt can access the gradle properly too.
 
  • #16
Paul Colby said:
https://stackoverflow.com/questions/19932793/syncing-android-studio-project-with-gradle-files

The third answer merely chose (highlighted) a different directory in the tree to get it to work. This is why I hate IDEs. A) it's like talking to space aliens and B) one is shielded from understanding the process. I've about exhausted what I can do on this one.
I'll try tomorrow and see if that works.

Anyways, you've helped a lot, and thanks for that. :smile:
 
  • #17
@Paul Colby wanted to let you know that the problem has been solved. The actual problem lay with the JDK, because the IDE was trying to work with a deprecated one. Gradle build could finally start properly.
 
  • Like
Likes Paul Colby
  • #18
Kind of surprised (and not) that the IDE couldn't check the java version and politely inform you that it's out of date. Glad you got it working.
 
  • Like
Likes Wrichik Basu
Back
Top