How to install app on android with gradlew.sh? - android

I have downloaded an android app from Github (Link). But I am unable to install this app on android (I am using Linux). Could someone tell me which direction should I go?
App folder Contains following files:
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

first install gradle this linke
then you can build the project on Command Line './gradlew assembleDebug'
This creates an APK named module_name-debug.apk in project_name/module_name/build/outputs/apk/. The file is already signed with the debug key and aligned with zipalign, so you can immediately install it on a device.

Related

Generating APK - gradlew is not recognised

Trying to generate signed APK for android using windows 10, I have generated my keystore but how do I run gradlew assembleRelease?
I have unzipped the binary into C:, added gradle to my path. However, gradlew is not recognised, and there is no build.gradle file in android/app/
The react native docs aren't very clear at all. Can anyone help?
Using Android Studio I cannot see any build options either.
Tried cd android && ./gradlew assembleRelease but get the error '&&' is not a valid statement separator
Menu in android studio looks like:
Even though I am using a Mac, it's the same on windows too: you can use the Build->Generate signed APK. That should work by default. If that it's not working I suggest to Invalidate caches and restart your android studio.
Go into your react native project directory and run
cd android && ./gradlew assembleRelease

Failed to build apk via Gradle

I'm trying to build apk from my Ionic project via gradle but it shows the following error:-
Note: I've tried the following solutions which didn't work for me:-
1) Removed nodejs, clear all directories related to nodejs, cordova, ionic, gradle and do fresh installation.
2) Change distribution url in graddle-wrapper.properties file in project folder to distributionUrl=https://services.gradle.org/distributions/gradle-1.12-all.zip and build again.
3) Installed ant4windows and executed $ rm -r ~/.gradle and hoping that ant will do the magic.
4) Downloaded gradle-2.12-bin.zip & replaced the 'gradle 2.2.1 zip' file in PC-User/.gradle/.. folder . but it still fetches gradle 2.2.1 zip & shows exception
Some days ago I successfully created my apk following https://www.youtube.com/watch?v=qVOwGyQB3DQ & the apk was built using ant. Also tell why gradle is taking over the ant this time?

Export unsigned apk from a Gradle Project in Android Studio

I usually create projects with Eclipse and import them into Android Studio, because I hate the project structure AS gives me. In it´s module settings, I have the possibility to create artifacts which allow me to output the built apk to a certain path.
Now I have created a Gradle project directly with AS and it seems that those projects have quite less options than eclipse projects. I don´t find anything to output my apk and I don´t find any apk inside my project folder after building.
How do I get my unsigned apk out of the build process??
Use
Build > Make Project
to build an apk file from Android Studio.
You can get your unsigned apk under the below path
$YOUR_PROJECT/$YOUR_MODULE/build/apk
unsigned apk files will have "unsigned" text in their names.
[ UPDATE ] :
In Recent release of Android Studio you will not get apk file on sysncing or Make Project. There are two other methods in order to get the apk file
Run the app
Execute assemble Task from Gradle panel present in right hand side of Studio window or from embedded terminal window on bottom(in project Root)
gradlew assembleDebug(or whatever build varient you want a build for)
and the update new apk path will be
$YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk
This has been done by Android Tools team to improve the Android Studio performance.
The above answer of pyus13 did not work for me (Android Studio 0.8.1).
Instead use
Run > Run "YourProject"
to build the code and create the unsigned apk. You can find your apk file under
$YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk
UPDATE
Still works with Android Studio 1.5.1
You only get new APKs when you have code changes since you last built your code.
Open Gradle panel, open the tasks list of your project and double click on BUILD task, then under " -> build -> outputs -> apk" you will find your unsigned APK with name -release-unsigned.apk
It is also possible to build an apk by using the command line (Android Terminal).
Choose the Terminal in Android Studio - very bottom next to Android Monitor and Version Control
Build apk with command
Windows: gradlew.bat assembleRelease
Mac: ./gradlew assembleRelease
Find unsigned apk file - /app/build/outputs/apk/app-release-unsigned.apk
Tested in Android 1.5
As of Android Studio 1.5 you can now generate an APK using
Build > Build APK
Which you can then find under
$YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk.
Edit:
New Android Studio gives this Path:
$YOUR_PROJECT/$YOUR_MODULE/build/outputs/apk.
Edit app.gradle buildTypes block, set
signingConfig null
Then rebuild.

ERROR: dump failed because no AndroidManifest.xml found

When I try to upload an application to Android Play store I get the following error:
ERROR: dump failed because no AndroidManifest.xml found
Steps that I took:
new HDD, install clean jre, jdk
download Android eclipse bundle - latest version today
make a new project, sample. simple hello world
sign it with the wizard, create a certificate etc.
try to upload it on the market...=ERROR!
I tried many combinations, different eclipse versions. Even to sign it manually. It doesn't work.
If I try to run aapt dump badging I get the same error.
Just write in the terminal
flutter clean
Just delete app.apk file from: /build/app/outputs/apk/app.apk.
Visual Studio will create a new correct app.apk file.
I dont know o 'why' of this.
I faced this problem using Visual Studio Code in a Flutter project and Im posting my solution because it can help others.
I just run 'Flutter Clean Project' and then I run the project.
All works again!
In my case the problem was with the filename: I accidentally (subconsciously) renamed it to .apk, when it should be .aab 🤦
following points are need to be taken care of while uploading file on
android market
"android:versionCode" attribute from AndroidManifest.xml is proper.
"android:versionName" attribute from AndroidManifest.xml is proper.
The package name is very unique,. Because all the apps on android market are separated by the package.
see all this is in place....
taken from while uploading file to android market error
I had this issue suddenly as well,
my solution was
flutter clean
flutter build apk
and it started working again
OPTION #1: Slow down an re-read every step. (Source).
Basic Setup for Signing.
Before you begin, make sure that the Keytool utility and Jarsigner
utility are available to the SDK build tools. Both of these tools are
available in the JDK. In most cases, you can tell the SDK build tools
how to find these utilities by setting your JAVA_HOME environment
variable so it references a suitable JDK. Alternatively, you can add
the JDK version of Keytool and Jarsigner to your PATH variable.
...
Eclipse Users
If you are developing in Eclipse/ADT (and have set up Keytool and
Jarsigner as described above in Basic Setup for Signing), signing in
debug mode is enabled by default. When you run or debug your
application, ADT signs the .apk file with the debug certificate, runs
zipalign on the package, then installs it on the selected emulator or
connected device. No specific action on your part is needed, provided
ADT has access to Keytool.
OPTION #2: Test the features required by your application with an unsigned '.apk'. (Source).
You can use the aapt tool, included in the Android SDK, to determine
how Google Play will filter your application, based on its declared
features and permissions. To do so, run aapt with the dump badging
command. This causes aapt to parse your application's manifest and
apply the same rules as used by Google Play to determine the features
that your application requires.
To use the tool, follow these steps:
First, build and export your application as an unsigned .apk. If you
are developing in Eclipse with ADT, right-click the project and select
Android Tools > Export Unsigned Application Package. Select a
destination filename and path and click OK. Next, locate the aapt
tool, if it is not already in your PATH. If you are using SDK Tools r8
or higher, you can find aapt in the /platform-tools/ directory.
Note: You must use the version of aapt that is provided for the latest
Platform-Tools component available. If you do not have the latest
Platform-Tools component, download it using the Android SDK Manager.
Run aapt using this syntax:
$ aapt dump badging <path_to_exported_.apk>
compile it & export the project under Linux (eclipse)
switch to InteliJ Studio (recommended)
It seems that from time to time there is a problem with eclipse under Windows 7,8.
flutter clean && flutter run
also works
I'm using VScode.
What happened:
After dart update, there was a permission error on flutter.bat
Solution:
Locate flutter.bat and give Full controll.
Open a cmd with Admin privileges, locate the folder that you are doing the development.
use 'FLutter clean' command (do not use vscode Terminal)
rerun app using 'Run without debug'
run flutter clean then flutter pub get. Then run your application, it should work
Error while run xamarin.uitest on using android sdk build tools 29.
Problem solved by changing android sdk build tools to 28.
I have same problem and solved by deleting all folders containing apk files in the location -
D:\FLUTTER\MY PROJECTS\SAMPLE\myapp\build\app\outputs.
if any folder is found access denied then force delete the folder or restart your system and try deleting the folder, then rebuild the app. It will work.
Go to the directory build/app/outputs/apk/debug , and the directory build/app/outputs/apk/flutter-apk . Erase the present files, once the compilation has run these files will rebuild and the error will disappear!

Android: How to build a .apk from the terminal?

I am developing a dynamic app generator, so I would need to run the command on a runtime basis using Java on a server
From the Android Developer site:
Managing Projects from the Command Line
Building APK from Command Line
You will need Gradle to build from the command line. Once you have that you can create the APK like this:
Windows:
> gradlew.bat assembleRelease
Unix:
$ ./gradlew assembleRelease
This creates your Android application .apk file inside the project
bin/ directory, named -unsigned.apk.
If you may rely on Android SDK, it is as simple as to generate build.xml and some properties file and invoke ant.
You may generate an android project by command android for reference.
ant release command builds release APK

Categories

Resources