Whenever I run gradlew assembleRelease either from a terminal or from within Android Studio, I see that the process ends successfully with "BUILD SUCCESSFUL". But after inspecting app\build\outputs I don't see any folder named apk.
Using the same build variant "release", the application can be installed into the device directly from Android Studio and the apk can also be successfully generated when using the "Generate Signed Bundle / APK..." option from the IDE.
I am using gradle 7.2.0.
Where should I look for to understand what is happening?
What could be causing this behavior?
Related
I was creating APK for my flutter project so I followed the below steps to generate a signed APK
Tools -> Flutter -> Open for editing in android studio
Then opened the model in a new window
I got the Gradle sync failed error, After my further investigation I run the command gradlew --warning-mode all in the terminal & I got the below message from gradle
The AbstractArchiveTask.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the destinationDirectory property instead.
Since I am new to flutter & always scared of Gradle failing, I am not sure how to fix this issue & set the destination directory
Or if you know how to create APK from the flutter project do let me know if I am doing anything wrong to generate APK
Gradle sync failed error is not any error in flutter.
to build apk in flutter first of all you run flutter clean command
then run flutter pub get command
after then you run flutter build apk command to build apk
also if you use Android Studio then you can build apk without command using
in Android Studio in top menu Build => Flutter => Build APK and click on Build APK
it will make apk for you
When I run a configuration, I can the gradle commands android studio is running to build the apk in the build tab (assembleDebug). But it is not showing me what command is run after that to actually install the apk on a device. Is there a way I can see this?
I'm tring to build my flutter app on android in CMD and got message (in the subject) but app works properly.
The build proccess was OK and the problem started afer I changed one of the dependencies.
I have 2 flavors.
The android studio build create app without errors.
Any idea?
It's possible that the command is unable to find the build path to generate the APK. You can run these commands in the Terminal built into Android Studio.
For building APK for prod
flutter build apk --flavor prod -t lib/main_prod.dart
For building APK for dev
flutter build apk --flavor dev -t lib/main_dev.dart
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
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.