gradlew missing in generated android project
Asked Answered
A

1

9

Okay I'm trying to do some android developing via command line / with an alternative IDE.

I have the following path variables set up:

  • jdk1.8.0_40/bin/
  • android-sdk-linux/tools/
  • android-studio/bin/
  • android-sdk-linux/platform-tools/

I run this command to make a project:

android create project --target 2 --name MyFirstApp --path ./MyFirstApp --activity MyActivity --package com.example.myfirstapp

The tutorial tells me to cd into MyFirstApp and run.

gradlew assembleRelease

There is no gradlew in this directory!

$ cd MyFirstApp/
$ ls
AndroidManifest.xml  build.xml         proguard-project.txt  src
ant.properties       libs              project.properties
bin                  local.properties  res

I've been trying for days but I need help doing this:

Use Gradle to build your project in debug mode, invoke the assembleDebug build task using the Gradle wrapper script (gradlew assembleRelease).

Apul answered 1/4, 2015 at 2:38 Comment(3)
the gradlew.sh and gradlew.bat are alway the same, you could copy from another project.Stylograph
Is this a gradle project? Where is the build.gradle file? Project build seems to be setup using ant. Have a look at the build.xml.Respondent
l ran "$ gradle init" in the "MyFirstApp" directory and it produced some new files including a "build.gradle".Apul
E
9

This is called the gradle wrapper, you have to generate it first. In your main build.gradle file, put:

task wrapper(type: Wrapper) {
    gradleVersion = '2.0'
}

Then run:

gradle wrapper

This has to be run once and you will get the gradlew file. You can then remove the wrapper task from your build.gradle file.

Erastatus answered 1/4, 2015 at 4:38 Comment(1)
Using the gradle I found at "android-studio/gradle/gradle-2.2.1/bin/" I ran "$ gradle init" in the "MyFirstApp" directory and now I have the gradlew I was searching for. I'm not sure where to go from here my comprehension is pretty low at this point.Apul

© 2022 - 2024 — McMap. All rights reserved.