Getting error while Creating apk with buildozer at root - android

I am getting following error with while creating apk using buildozer.
I an using Ubuntu 16.0.4 and running as root
Check that aidl can be executed
Search for Aidl
Run /root/.buildozer/android/platform/android-sdk-20/build-tools/20.0.1/aidl
Cwd None
Aidl cannot be executed
You might have missed to install 32bit libs
Check http://buildozer.readthedocs.org/en/latest/installation.html
Check configuration tokens

You don't really need to run buildozer with root. The .buildozer folder will be created under $HOME e.g. /home/user-name/.buildozer
With regards to the missing aidl file,
you need to run android in /root/.buildozer/android/platform/android-sdk-20/tools/ to update Android SDK, and aidl will be installed. You might have to run this a few times until you see a folder build-tools (/root/.buildozer/android/platform/android-sdk-20/build-tools) with subfolders 19.1.0, 23.0.1, etc.
cd /root/.buildozer/android/platform/android-sdk-20/tools/
./android

Related

Some Kivy Buildozer related stuff I'm not sure about

My Setup:
VM VirtualBox on windows 7 home p.
Guest - Linux Ubuntu 14.04
I have installed buildozer and dependencies and can run buildozer android debug and get an apk in the bin folder of the root project directory.
I have some questions that are killing me.
Why is it when I call buildozer android release, no apk gets placed in the bin folder in the project root directory. Instead I find the release apk in .buildozer......dist/mygame/release.unsigned-apk? Is it suppose to be there?
I can use keytool to create a .keystore file and run jarsinger... but, I don't have DIR ~/.buildozer/android/platform/android-sdk-21/build-tools/22.0.1/zipalign -v 4. If buildozer downloaded the android sdk and ndk, should I have zipalign somewhere? How can I build a debug apk if I didn't have the sdk and ndk? So how come I don't see an sdk or ndk folder anywhere on my system?
In my spec file, I use requirements kivy=master. Is that ok?
PS, I know the sdk and ndk were downloaded because it took forever to get those but where are they?
The release apk doesn't go to the bin folder in root, but by default goes to the bin folder in distrb directory, which is in the hidden .buildozer path (in the root project folder). Only the debug release goes to the bin folder that gets created in the project root.
The NDK and SDK were found in the hidden .buildozer path located in my Home directory. Linux Ubuntu is one system that would be superior in the game "hide-n-seek"...if it were human..... Which might happen given the way mankind constant feed human life and soul into machines. :D

Cordova's distro files (jar) are not generated

I'm trying to start a simple Cordova 3.0.0 project under Windows. Development environment (including Java, Eclipse, Ant, Android SDK) does exist and has been already used for numerous native apps.
I was able to create a "hello" project using:
>create hellocordova com.example.hellocordova "HelloWorldCordova"
Creating new android project...
Building jar and js files...
Copying template files...
Copying js, jar & config.xml files...
Creating appinfo.jar...
Copying cordova command tools...
Updating AndroidManifest.xml and Main Activity...
It worked ok, though there are no distro files in the project.
After that I've tried to build Cordova's distro files using update:
>update hellocordova
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
Building jar and js files...
Copying js, jar & config.xml files...
Copying cordova command tools...
It does not show any errors, but the files cordova-3.0.0.jar and cordova-3.0.0.js are missing in respective folders (libs and assets/www) where they should appear.
The problem could possibly be related to API Level (though I'm not sure how). check_reqs reports:
Please install Android target 17 (the Android 4.2 SDK).
Yes, I have 4.1 as the highest API level at the moment and would like to keep it so. But I don't see in Cordova scripts any indication that the level must be exactly 17, except for the check_reqs itself, which seems not involved in building process.
I'd appreciate suggestions how to fix this.
It looks like I missed the step which does actually build the jar-file:
ant jar
for Cordova framework project. I didn't see this in the documentation.
After further investigation I found that create and update executes this command inside:
exec('ant.bat -f \"'+ ROOT +'\\framework\\build.xml\" jar');
The problem is that the command executes well manually, that is it produces the jar, but it silently fails to produce it when invoked inside create or update. For clarity I outputted the resulting command line from update, then copy & paste it and run in shell in the same directory. This works properly.
I had the same problem as you for the last couple of hours and problem came (silently as you said :D) from ant. My version of ant was not recent enough (1.7 instead of 1.8).
After updating it seems to work great (jar generated in correct file) even automatically (read inside the phonegap command scripts like run android).
I had the same issue but i was missing
ANDROID_HOME=C:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_17\bin
And the Path to Java.
the -d ( i think debug ) will give you more information.
create -d hellocordova com.example.hellocordova "HelloWorldCordova"
this was on Cordova 3.0.9 and adt-bundle-windows-x86_64-20130729.
Als do not forget to update the SDK so the you have the corect Android platforms.

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!

How to compile APK from command line?

I am interested in making Android apps on demand. Depending on the clients request, my web site would send me a JSON file direct to a Windows application that I have created in Delphi. This one would save the file inside the Android app source folder and then, execute a command line telling the Android compiler to generate the APK file and send it to my client, all that without my presence.
The Android project was made with MotoDev. And it uses the Android SDK that is in my root.
How should I configure the command line to achieve this from inside my Delphi program?
I will also need to change the manifest to put a new version number so it does not conflict with other clients version.
Android uses the Ant build system, so you can create a build.xml and build.properties file for your project.
You'll need to create the build.xml file first though:
android update project -p .
This will generate a build.xml file. You should probably customize the build steps and targets for your project. A good idea in your case would be to have the build.properties file generated by your website for the specific build... Then include it via the build.xml file. In particular, you will need to specify in the build.properties file where the signing keys are, and what the password is:
Build.Properties:
key.store=keystore.dat
key.alias=signing_key
key.store.password=password123
key.alias.password=password123
The build process using ant also allows you to do variable replacements in Java files, which might be another idea. It would allow you to customize the build process further on a client by client basis.
By default, the build is triggered by:
ant clean
ant release
Another neat idea: Have Ant copy the resulting APK file to a network share accessible by the website by placing a < copy ... /> line in the < target name="release" > section.
Create build.xml at project creation time
If you start a new project with:
android create project \
--target 1 \
--name MyName \
--path . \
--activity MyActivity \
--package com.yourdomain.yourproject
the build.xml file used by ant will be generated.
The android tool is present in the tools/ directory of the SDK which you downloaded.
Create debug releases
Besides:
ant release
for final releases, you can also create debug releases with:
ant debug
Location of generated apk
Generated apk are placed under bin/.
The most important outputs are:
MyName-debug.apk
MyName-release.apk
but some intermediate apks are also generated, in particular unaligned and unsigned versions.
But most of the time you can forget where they were created and just run:
ant debug install
ant release install
to get them installed. But make sure it is working with adb first: adb devices command not working
Tested on Ubuntu 15.10, Android 23.
Android doesn't directly use ANT build systems now. It uses Gradle, which is based on Groovy. You can learn more about build systems here.
You can see the list of available tasks you can run on using this command
gradlew tasks
To initiate a debug build, invoke the assembleDebug task
gradlew assembleDebug
You can install your app using the adb tool via this command
adb install path/to/your_app.apk
To learn more about building on command line, follow this comprehensive article.
Also you can read this article on "Why Build Your Java Projects with Gradle Rather than Ant or Maven?"

How do I update an Android project from a Jenkins job?

I am setting up Jenkins to clone my git project, update the project, then build using ant. If I perform an ls in the job after cloning the repo, I see my project.properties file present (containing target).
To update the project (and therefore generate the build.xml file) I issue the following command:
android update project -p ./
However, I get the following console output:
Error: The project either has no target set or the target is invalid.
Does anyone know how to update an android project from Jenkins and avoid this problem?
So you've eliminated the first part of the error (i.e. the project does have a target set), but not the second part.
The message "target is invalid" means that you don't have the target platform installed in the Android SDK that Jenkins is using.
e.g. if your target is android-17, then you need to install the Android 4.2 platform (for example via the command android update sdk -u -t android-17).
As an aside, you can automate both the relevant calls to android update -p and the installation of required target platforms using the Android Emulator Plugin for Jenkins.

Categories

Resources