Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradlew missing in generated android project

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).

like image 995
John Smith Avatar asked Apr 01 '15 02:04

John Smith


Video Answer


1 Answers

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.

like image 172
Philippe Goncalves Avatar answered Oct 10 '22 22:10

Philippe Goncalves