ERROR: dump failed because no AndroidManifest.xml found - android

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!

Related

Trying to build an Ionic 4 app for Android but gradle, paths and variables aren't found even though I've already set them

everyone. I want to build an app for one of my clients. It's the first time I develop an app on Ionic 4 and at the time of building the apk, I couldn't do it.
I checked all the errors that the console prompted to me. At first, it seemed to be moving on, however, at a moment, the console prompted the following:
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/Cris/Library/Android/sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release exited with exit code 1.
I have already done a research about this topic, and even though there are similar questions here on this website, I couldn't find any answer that solved my problem.
I have already defined the ANDROID_SDK_ROOT, the ANDROID_HOME and GRADLE_HOME. I checked all of those dirs to see if they worked, and they did so. I have already downloaded and set up the JDK variable and path as well.
I have installed Android Studio with the version of sdk API that I need for this development. Also, when I researched about gradle, I installed it with npm and manually (without counting the time it got installed automatically with Android Studio). HOWEVER!!! The console tells that gradle isn't installed, that Android paths aren't set or that they are deprecated (both options, actually), and that I have to do what I have already done several times.
Here I let you see the variables set:
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
export ANDROID_HOME=/Users/Cris/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export GRADLE_HOME=/Users/Cris/Library/Gradle.0/bin
export PATH=$PATH:$GRADLE_HOME
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
Do you guys have any idea of how to proceed? Thank you before hand
GRADLE_HOME should be the root folder of the <gradle installation folder>, currently its pointing to <gradle installation folder>/bin it should look like following
export GRADLE_HOME=/Users/Cris/Library/Gradle.0
I have already overcame the problem with the following instructions:
When you want to build your app for Android with Ionic 4 on MAC, install Java (JDK), install Android Studio, install the API version you want to work with, install Homebrew (on its website there is a so easy-to-follow guide to install it) and install Gradle by writing the following command:
brew install gradle
Then, write the following command and copy the route of the gradle directory:
brew info gradle
Go to Ionic Framework Developer Resources for MAC
And follow the instructions to set up the paths. Don't forget to check if the example paths work just fine on your computer by doing it as the following example:
ls /Users/your-user/Library/gradle-5.4
If the "echo" of that line says that the directory exists, then it's okay and you must set that path the way it is. If the directory doesn't exists (as it'll happen in the case of the $GRADLE_HOME's path, you should paste the route that you copied some steps ago.
To corroborate that those paths exist on your MAC, besids saving them on your MAC's ~/.bash_profile, enter them one by one (exporting the variable and exporting its path) inside the MAC's terminal.
Then, as one of the last steps (I'm not going to describe how to sign your app, because it's explained on the link above), write on a console opened inside your project the following line:
sudo ionic cordova build android --prod
It's going to build your app for production, which releases you from signing your app in order to install it on your mobile device
IMPORTANT NOTE:
If you want to sign your app, you should run the following command before signing it (it replaces the last command I wrote above):
sudo ionic cordova build --release android
You can find more information about releasing your app without a signed key and how to sign it on this website's section:
Publishing Your App - Ionic Framework
Thank you for checking this answer out! :D

Android Studio - Error: Local path doesn't exists - No apk generated

I recently downloaded latest version of Android Studio today. I configured and setup everything properly but when i create a new project and try to run and debug in the connected phone, it will show this error.
Error: Local path doesn't exists.
Also, i search for apk file but no apk was generated anywhere.
I am using Android Studio 1.0 built on December 5 2014.
SDK manager is also no starting from Android studio.
Please help.
I got the same problem since update to 1.0 version, the bug comes from an internal script which is supposed to finds the distribution of Java but isn't working correctly on 32-bit Windows systems (SDK Manager was also impossible to run) and it has been fixed in the 24.0.1 release of the SDK.
Solution :
In line 27 of tools/lib/find_java.bat has a problem:
find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64
You must remove space after "arch_ext=32". Correct code is:
find /i "x86" > NUL && set arch_ext=32|| set arch_ext=64
You should be able to open SDK Manager by now, and update Android SDK Tools.
Read this possible duplicate
Android Studio - local path doesn't exist
As for the APK, it does not get generated unless you do it.
It is meant for release your project into android file format when you are ready to distribute it.
I took a screenshot for you to see:
If you are using studio on Windows and your windows username contains special symbols like '&' - RENAME YOUR USERNAME (and user folder)!
My Issue has been resolved by following answer here https://www.reddit.com/r/androiddev/comments/2pfm2e/android_studio_local_path_doesnt_exist/ .
Please find the main points as follows.
Assuming you are on a mac/linux machine. If on Windows, use "gradlew.bat" instead of "./gradlew":
1) Close Android Studio
2) Open command line to the root of your project (the location of gradlew)
3) Run "./gradlew clean" to clean your project
4) Run "./gradlew --stop" to kill off any remnant Android Studio gradle daemons which may be caching stuff
5) Run "./gradlew assembleDebug" to build your project anew. (I am assuming you are building a basic debug configuration. If not, feel free to run "assemble" with your custom configuration.) If there are any issues with the project, you will see them here.
6) Restart Android Studio and try building again.

How do I put my cordova application on the android play store?

If there is official cordova documentation for this, I couldn't find it and would appreciate a link. I have run cordova run android to deploy to my phone. Things look good. Now I'm ready to turn this into an official app that users can download on the android play store? When I build my app it generates a file named "CordovaApp-debug.apk". That "debug" part makes me think this is the wrong file to work with, but I'm not sure how to generate the right file.
Deploying a hybrid app to the Google Play Store
These steps would work for Cordova, PhoneGap or Ionic. The only difference would be, wherever a call to cordova is placed, replace it with phonegap or ionic, for your particular scenario.
Once you are done with the development and are ready to deploy, follow these steps:
Open a command line window (Terminal on macOS and Linux OR Command Prompt on Windows).
Head over to the /path/to/your/project/, which we would refer to as the Project Root.
While at the project root, remove the "Console" plugin from your set of plugins.The command is: cordova plugin rm cordova-plugin-console
While still at the project root, use the cordova build command to create an APK for release distribution.The command is: cordova build --release android
The above process creates a file called android-release-unsigned.apk in the folder ProjectRoot/platforms/android/build/outputs/apk/
Sign and align the APK using the instructions at https://developer.android.com/studio/publish/app-signing.html#signing-manuallyAt the end of this step the APK which you get can be uploaded to the Play Store.
Note: As a newbie or a beginner, the last step may be a bit confusing as it was to me. One may run into a few issues and may have some questions as to what these commands are and where to find them.
Q1. What are jarsigner and keytool?
Ans: The Android App Signing instructions do tell you specifically what jarsigner and keytool are all about BUT it doesn't tell you where to find them if you run into a 'command not found error' on the command line window.
Thus, if you've got the Java Development Kit(JDK) added to your PATH variable, simply running the commands as in the Guide would work. BUT, if you don't have it in your PATH, you can always access them from the bin folder of your JDK installation.
Q2. Where is zipalign?
Ans: There is a high probability to not find the zipalign command and receive the 'command not found error'. You'd probably be googling zipalign and where to find it?
The zipalign utility is present within the Android SDK installation folder. On macOS, the default location is at, user-name/Library/Android/sdk/. If you head over to the folder you would find a bunch of other folders like docs, platform-tools, build-tools, tools, add-ons...
Open the build-tools folder. cd build-tools. In here, there would be a number of folders which are versioned according to the build tool-chain you are using in the Android SDK Manager. ZipAlign is available in each of these folders. I personally go for the folder with the latest version on it. Open Any.
On macOS or Linux you may have to use ./zipalign rather than simply typing in zipalign as the documentation mentions. On Windows, zipalign is good enough.

Build android release apk on Phonegap 3.x CLI

How can I build an android app locally using the Phonegap 3.x CLI, ready to release? I check the bin folder generated inside the platforms/android directory of the project, and only has .debug APKs.
By the way, I use this command: phonegap local build android
This is for Phonegap 3.0.x to 3.3.x. For PhoneGap 3.4.0 and higher see below.
Found part of the answer here, at Phonegap documentation. The full process is the following:
Open a command line window, and go to /path/to/your/project/platforms/android/cordova.
Run build --release. This creates an unsigned release APK at /path/to/your/project/platforms/android/bin folder, called YourAppName-release-unsigned.apk.
Sign and align the APK using the instructions at android developer official docs.
Thanks to #LaurieClark for the link (http://iphonedevlog.wordpress.com/2013/08/16/using-phonegap-3-0-cli-on-mac-osx-10-to-build-ios-and-android-projects/), and the blogger who post it, because it put me on the track.
In PhoneGap 3.4.0 you can call:
cordova build android --release
If you have set up the 'ant.properties' file in 'platforms/android' directory like the following:
key.store=/Path/to/KeyStore/myapp-release-key.keystore
key.alias=myapp
Then you will be prompted for your keystore password and the output file (myapp-release.apk) ends up in the 'platforms/android/ant-build' directory already signed and aligned and ready to deploy.
In cordova 6.2.0
cd cordova/ #change to root cordova folder
platforms/android/cordova/clean #clean if you want
cordova build android --release -- --keystore="/path/to/keystore" --storePassword=password --alias=alias_name #password will be prompted if you have any
Previous answer:
According to cordova 5.0.0
{
"android": {
"release": {
"keystore": "app-release-key.keystore",
"alias": "alias_name"
}
}
}
and run ./build --release --buildConfig build.json from directory platforms/android/cordova/
keystore file location is relative to platforms/android/cordova/, so in above configuration .keystore file and build.json are in same directory.
keytool -genkey -v -keystore app-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Following up to #steven-anderson
you can also configure passwords inside the ant.properties, so the process can be fully automated
so if you put in platform\android\ant.properties the following
key.store=../../yourCertificate.jks
key.store.password=notSoSecretPassword
key.alias=userAlias
key.alias.password=notSoSecretPassword
just wondered around a lot because I got the same issue but in my installation the command "cordova" was never available and "phone gap build android --release" just ignored the platform/android/ant.properties.
so looking inside my platform filter I found a folder named "cordova" and inside of it there was an "build" binary that accepted the --release argument, it asked me for the key chains and I ended with a signed and ready for production APK.
this was never documented in any part of the phone gap site and frankly speaking now I kinda hate phonegap :( it was supposed to make the things easier but everything was just complicated :(
Building PhoneGap Android app for deployment to the Google Play Store
These steps would work for Cordova, PhoneGap or Ionic. The only difference would be, wherever a call to cordova is placed, replace it with phonegap or ionic, for your particular scenario.
Once you are done with the development and are ready to deploy, follow these steps:
Open a command line window (Terminal on macOS and Linux OR Command Prompt on Windows).
Head over to the /path/to/your/project/, which we would refer to as the Project Root.
While at the project root, remove the "Console" plugin from your set of plugins.The command is: cordova plugin rm cordova-plugin-console
While still at the project root, use the cordova build command to create an APK for release distribution.The command is: cordova build --release android
The above process creates a file called android-release-unsigned.apk in the folder ProjectRoot/platforms/android/build/outputs/apk/
Sign and align the APK using the instructions at https://developer.android.com/studio/publish/app-signing.html#signing-manuallyAt the end of this step the APK which you get can be uploaded to the Play Store.
Note: As a newbie or a beginner, the last step may be a bit confusing as it was to me. One may run into a few issues and may have some questions as to what these commands are and where to find them.
Q1. What are jarsigner and keytool?
Ans: The Android App Signing instructions do tell you specifically what jarsigner and keytool are all about BUT it doesn't tell you where to find them if you run into a 'command not found error' on the command line window.
Thus, if you've got the Java Development Kit(JDK) added to your PATH variable, simply running the commands as in the Guide would work. BUT, if you don't have it in your PATH, you can always access them from the bin folder of your JDK installation.
Q2. Where is zipalign?
Ans: There is a high probability to not find the zipalign command and receive the 'command not found error'. You'd probably be googling zipalign and where to find it?
The zipalign utility is present within the Android SDK installation folder. On macOS, the default location is at, user-name/Library/Android/sdk/. If you head over to the folder you would find a bunch of other folders like docs, platform-tools, build-tools, tools, add-ons...
Open the build-tools folder. cd build-tools. In here, there would be a number of folders which are versioned according to the build tool-chain you are using in the Android SDK Manager. ZipAlign is available in each of these folders. I personally go for the folder with the latest version on it. Open Any.
On macOS or Linux you may have to use ./zipalign rather than simply typing in zipalign as the documentation mentions. On Windows, zipalign is good enough.
i got this to work by copy pasting the signed app in the same dir as zipalign. It seems that aapt.exe could not find the source file even when given the path. i.e.
this did not work
zipalign -f -v 4 C:...\CordovaApp-release-unsigned.apk C:...\destination.apk
it reached aapt.exeCordovaApp-release-unsigned.apk , froze and upon hitting return
'aapt.exeCordovaApp-release-unsigned.apk' is not recognized as an internal or external command, operable program or batch file.
And this did
zipalign -f -v 4 CordovaApp-release-unsigned.apk myappname.apk
I know this question asks about Phonegap 3.X specifically, but just for reference any Phonegap version above 4.0.0 uses Gradle instead of Ant to build by default. To use Ant instead of Gradle you can add this to your config.xml:
<preference name="android-build-tool" value="ant" />
When using Gradle the keystore signing information now needs to go into a new location (as outlined in this post). Create new file called 'release-signing.properties' in the same folder as "build.gradle" file and put inside the following content:
storeFile=..\\..\\some-keystore.keystore
storeType=jks
keyAlias=some-key
// if you don't want to enter the password at every build, you can store it with this
keyPassword=your-key-password
storePassword=your-store-password
You could try this command, it should build and run the app (so .apk should be created) :
phonegap local run android

How to generate R.java manually on Linux platform

I am developing android application on Linux platform because i have to make a system.img with a application.
When adding a drawable resource and building the project with mm command, i met a below error.
"cannot find symbol
R.drawable.icon_send_type"
At above error, the icon_send_type is the added resource.
This error occurred because the mm command did not generate R.java.
So, I want to know how to generate R.java by a manual on Linux platform.
I solved the error that the R.java was not generated by mm command on linux platform.
The drawable resource's date was the problem.
I used a linux's touch command in res/drawable folder and i run the mm command, then R.java generated renewedly.
Try to remove the R.stamp file from your intermediates directory, like
out/target/common/obj/YOUR_APP_intermediates/src/R.stamp
Developing on Linux is no reason for not using the whole Eclipse IDE and the integration of all the tools that it brings you.
If you can't use Eclipse you can build your project with ant. If you create a project with the Android SDK there should be an ant file that helps you to build your project. I recommend reading this part of the documentation on how to work with other IDEs or without Eclipse.
I found tons of solutions about this problem, none worked.
My problem relied on Android SDK installation.
The ADT plugin for eclipse installed the SDK without the build tools, incredible but true.
So I brought to sight the Android sdk manager:
windows --> customize perspectives... --> command groups availability (I checked Android SDK and AVD manager)
After that I installed the build tools:
Window --> Android SDK manager (I checked the build tools for android)
Close and restart eclipse
Finally the CLEAN command worked

Categories

Resources