0

I am trying to make an app for android, just a small little "Hello World" app to assess how it all works. I have tried on numerous occasions to get gradle to wrap the app but I just keep running into error after error after failed attempt... This is more or less the procedure that I have used on 3+ occasions:

  1. I install android studio, jdk 17, and gradle (default install ver. 4 had to remove and wget the .deb for v8)

  2. point JAVA_HOME:

    export JAVA_HOME=/PATH/TO/JAVA

    export PATH=$JAVA_HOME/bin:$PATH

  3. make my basic app structure and starting code and verified with ai

  4. thought gradle wrapper needed to run in project root, then learned that it needs to run in the main folder. ran gradle wrapper in .../app/src/main/

  5. chmod +x gradlew

  6. and then ./gradlew assembleDebug

    At this point, either only default tasks are available (or a short list with nothing helpful) or a longer list that does not include assembleDebug and even when I just try to do ./gradlew build, the build fails immediately. I removed any scrap of JDK or gradle from my system so if anyone can tell me maybe where i am going wrong here I would appreciate it

New contributor
user31958440 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 1
    Please edit your post to describe what you did in "make my basic app structure and starting code". You should be able to make a "Hello World" app using Android Studio and execute from inside of Android Studio. Commented Nov 28 at 2:05
  • I've always run the grade wrapper from the project root folder. Unsure why you would run it from app/src/main. In any case, if a build fails, it probably shows error messages, which might hint at what the problem might be. Commented Nov 28 at 4:03
  • 1
    Please edit your question ind post the gradle output if it fails. Post it as text formatted as code (encapsulated in three backticks) , not as screenshot. Commented Nov 28 at 8:14
  • app/src/main is not the root directory and there is no build.gradle present. Commented Nov 28 at 9:24

1 Answer 1

2

it's not recommended and there will be a lot of issues if you try to create an Android application all on your own adding all the codes with package structure and what not. Go to Android Studio-> New -> New Project-> Empty Activity (for Jetpack Compose) or Empty Views Activity (for XML layout). It already comes with basic code for Hello World these days. Then you can prompt AI to make changes in your MainActivity although I'd highly recommend checking out tutorials and courses that are available to you. There are a ton in Youtube and developer.android.com also provides many tutorials.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.