APK failed to install on AVD despite installing on actual device - android

I created a Kivy app and created a debug APK using Buildozer in a Linux virtual environment (my host laptop is Windows). When pushing this to my phone, the app works perfectly fine and 100% as expected. Before trying to push this to the Play Store, I wanted to test it on different devices using an emulator.
I installed Android Studio on my host laptop (as I am more comfortable there than Linux) and copied my .apk over. When I try and drag and drop my .apk into my Android virtual device, I get an error that says:
APK failed to install
Error: Could not parse error string
I even tried installing it directly into my emulator, by navigating to the platform-tools folder in the Sdk file, and copy and pasting my .apk there, and then trying to install it directly from cmd using:
adb install myapp-0.1-armeabi-v7a-debug.apk
however then I get an error message saying
adb: error: failed to get feature set: no devices/emulators found
When I check this in Android Studio by going to Tools > SDK Manager > SDK Tools tab, it clearly says that SDK manager and Emulator are both installed.
What am I doing wrong, and how can I sort this?
Thank you

The reason for this was that the Android architecture needed to be x86 in order to run on the emulator.
To correct it, I had to change:
android.arch = armeabi-v7a
to
android.arch = x86
and then create the debug APK.
It might be necessary to change the p4a branch to develop and run a buildozer android clean to clean the build.

Related

Content too short error while using Buildozer with a kivy-python application

I'm trying to package my application to an apk using Buildozer. I got WSL and Ubuntu working, along with buildozer and most of the dependencies. When I run buildozer android debug deploy run or buildozer -v android deploy run the Ubuntu console tries to install the Android NDK and eventually fails. It will download to about 25%-40% and then the error shown in the screenshot will display.
I've tried disabling my firewall, and I've also tried this solution even though I do have internet: No internet connection on WSL Ubuntu (Windows Subsystem for Linux)
Please let me know if you need any more information, thanks!
I just installed the dependency without running Buildozer and made sure it was in the Buildozer directory. Fixed the issue.

INSTALL_FAILED_NO_MATCHING_ABIS when trying to run an x86-64 APK on an x86-64 AVD in QtCreator

I don't want to plug in my phone each time I try to run a compiled APK and also ARM emulation is quite slow in x86 systems.So I decided to add a kit in the QtCreator IDE merely to build APKs for x86 to be able to run them easily in the AVD.
There's no error or warning related to the kit configuration in the IDE but when I build the project to run it on my x86-64 AVD , I get this:
adb: failed to install whatever.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
Installing to device failed!
By the way I'm sure I'm using the correct AVD in the Select Android Device window and I've installed the x86_64 components for Qt via the Maintenance Tool.
What am I missing?
Finally I found the answer myself.Here's the instructions:
Go to Projects mode:
2.Under the Build Steps section select the desired ABI(For Qt 5.14 when you install Android tools via the MaintainerTool program,libraries for all of these ABIs would be installed automatically):
Hope it helps the future readers to save some time.

INSTALL_FAILED_TEST_ONLY in Android studio 2.4 preview 7

I'm using Android Studio 2.4 preview 7 version. But, when I build debug apk and install via adb command or put apk file in sdcard of device it always gives me same error "App not installed" in any of android phone. I have got INSTALL_FAILED_TEST_ONLY error in Android Logcat every time at the time of installation in any android device.
If you analyze your apk file you'll see the problem easily - namely that when building the project with the mentioned Android Studio version, the Gradle plugin is automatically injecting an android:testOnly=true to the final AndroidManifest.xml file of the output apk.
You can read more about this property and what it's used for HERE.
To workaround this problem - you can still install the app using this command:
adb install -t debug.apk
If you want to build a signed release version of your app (e.g. for publishing the Play Store), you can always do so via Build -> Generate Signed APK. The result is an apk without the mentioned property and can be installed on any device.
If you want a bit of context why this property is injected, perhaps check THIS and THIS issues on the AOSP bug tracker.

Visual studio cordova tools - unable to run / debug / deploy to android. adb hangs

I'm trying to build / deploy and debug by pressing F5 on my Cordova Tools javascript project with a variety of android targets but the apk does not want to deploy.
It appears that the build completes and deploys successfully and the ADB console windows appears but remains blank. No app is deployed to a device or emulator.
Have tried Nexus 5, Samsung Galaxy Tab 2 and various emulators. All devices have been used as debug targets before
The thing that has changed is that I recently formatted my laptop and moved to Windows 10 Enterprise
I'm using a fresh installation of Visual Studio 2015 Enterprise
I can debug OK on Windows Phone 8.1, Windows 10
If I try and deploy the APK created from the console with ADB:
adb install android-debug.apk
I get
3715 KB/s (1141677 bytes in 0.300s)
pkg: /data/local/tmp/android-debug-unaligned.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
I haven't tinkered with the APK it is as it was built from VS
I have tried clearing the cache, checking the dependencies (both in Options) and checked for updates.
Any suggestions on how to move forward?
Thanks
Solved. Turns out the config.xml settings were incorrect. Config.xml > Common > Package name needs to be in reverse domain name notation for android to deploy to the device.
I hadn't noticed this however because I had only been using the Cordova Tools project to compile for Windows 8.1 / 10 devices and in these build configurations the package naming convention is not enforced
This caused the problem:
Package name: mycompany.myappname
This fixed the problem:
Package name: com.mycompany.myappname
Try in the command line/terminal, navigate to the root of your project folder, and enter "cordova platform remove android.” Then, rebuild the solution again (which will generate platform/android from a clean state)

Silent install of Android Studio?

I'm trying to install Android Studio IDE on multiple Windows and I'm having some problems with the parameters.
Since our deployment environment doesn't support the type of packages android studio uses, I did a simple batch file to install Android Studio silently:
cmd /c start /wait android-studio-bundle-141.1903250-windows.exe /NCRC /S /D=C:\Android\android-studio\1.41
Unfortunately, although the silent install works, the /D switch doesn't look like it's working and it installs itself by default in program files.
I was able to reproduce your results with the latest version of the installer. So I have reported it

Categories

Resources