Help required in setting up Android Studio

Click For Summary

Discussion Overview

The discussion revolves around setting up Android Studio, specifically addressing issues related to Gradle build errors encountered during project creation. Participants explore various potential causes for the errors, including SDK and JDK configurations, and the impact of using different drives for installation.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant describes their setup process for Android Studio and the Gradle build errors they are encountering.
  • Another participant suggests switching to a different coding environment, but the original poster prefers to stick with Android Studio due to the tutorial they are following.
  • Several participants discuss the challenges of interpreting error messages and debugging setup issues, noting that tutorials may become outdated as software evolves.
  • There is speculation about potential issues with library paths and configurations, particularly regarding the use of different drives for installation.
  • A participant mentions a specific error related to the JVM and memory allocation, prompting further inquiry into the setup.
  • Links to external resources are shared, suggesting that changing directory settings may resolve the issues.
  • Ultimately, one participant reports that the problem was resolved by updating the JDK, which was previously deprecated.

Areas of Agreement / Disagreement

Participants express various viewpoints on the causes of the issues, with some suggesting configuration problems while others focus on the tutorial's relevance. There is no consensus on the initial cause of the Gradle build errors until the JDK issue is identified.

Contextual Notes

Participants note that the IDE and libraries may not always be compatible, and that error messages can be difficult to interpret. The discussion reflects the complexity of software setup and the potential for outdated tutorials to contribute to confusion.

Who May Find This Useful

This discussion may be useful for individuals setting up Android Studio for the first time, particularly those following specific tutorials and encountering build errors.

Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,186
Reaction score
2,694
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: 640
  • Android Studio problem #2.JPG
    Android Studio problem #2.JPG
    52 KB · Views: 549
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   Reactions: 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   Reactions: 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   Reactions: 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   Reactions: Wrichik Basu

Similar threads

  • · Replies 1 ·
Replies
1
Views
5K
Replies
3
Views
1K
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K