I have a question with flutter build aar command line and target platform.
flutter build aar has a option --target-platform
When using flutter build aar --target-platform android-arm64, It seems to build an aar targeting arm64.
I checked the docs.
Apps built for ARMv7 or ARM64 run fine (using ARM emulation) on many x86 Android devices.
https://docs.flutter.dev/resources/faq#what-devices-and-os-versions-does-flutter-run-on
Looking at the above document, it is stated that the app built with arm64 run fine on many x86 Android devices.
Does this mean that Android host App embeded aar built with flutter build aar --target-platform android-arm64 will run fine on x86 Android devices?
Related
First of all I'm not an android dev
I have an apk which only supports arm.
I decompiled it with apk tool.
And now i have it as smali files.
Can this be compile with x86 abi support by building it again with gradle in android studio?
Or is there any other way to add x86 support to that apk?
that depends on native code/libs used in your project, but generally you can build an x86 apk in Android Studio. there is no way for "migrating" arm APK to x86 (or any other) without sources and building whole up again. some clues HOWTO in HERE (abiFilters 'x86') and/or HERE (include "x86")
I am trying to build a release app with low file size in Flutter. Yesterday the release apk size was around 16mb, but after I updated the flutter, the size goes to 23mb.
After some researching, I fount out that flutter generates app bundle with all of the ABIs in it and after the update, new API has been added to apk.
After adding app to android studio apk analyzer, I can see the different ABIs in them as below:
x86_64 7.1mb
arm64-v8a 7mb
armeabi-v7a 6.8mb
I can use flutter build apk --split-per-abi to generate apks for different ABIs.
Now the question is, can a arm64-v8a system run x86_64 apk? (or the otherwise).
Or can any of these ABI apk releases, be run in all the devices?
I don't release my app on app stores, I just put it on my clients website and their clients will download it from there (or it will be sent to them by email, ... ). So I need one release that works in all of the android devices and the full bundle release is way too large (23mb).
EDIT:
I just tested x86_64 build on a arm64-v8a device and it did not install. but the armeabi-v7a version did install.
I did some research and tried the release versions on different devices and this is the result:
The command is : flutter build apk --split-per-abi
The x86_64 apk version does not work on any other devices. I could not find an x86_64 device but I assume it will work on x86_64 devices!
The arm64-v8a apk version gets installed on arm64-v8a but it will not install on armeabi-v7a devices. (armeabi-v7a is older than
arm64-v8a).
armeabi-v7a apk version works on armeabi-v7a and arm64-v8a devices. I did not find an x86_64 device but I think it will work on this
device too.
Summary: The newer version of the ABI can run the older apk builds. The order is: armeabi-v7a then arm64-v8a then x86_64.
For example, armeabi-v7a will install and work on all of the devices and if you build and arm64-v8a apk, it will NOT install on armeabi-v7a devices.
There are other architectures that are no longer used (mips, mips64, armeabi) and Flutter by default, will not contain them in builds.
the X86 and X86_64 architectures are for very limited number of devices, but may be useful for debugging in the emulator.
This was the result of my researches and testings. I decided to only use the armeabi-v7a so the apk size will be 8mb instead of 23mb.
If someone else having this question/trouble, I hope this helps :).
Write this command on the cli of your vscode or android studio to build a 3 version of your flutter android project:
flutter build apk --target-platform android-arm,android-arm64,android-x64
https://flutter.dev/docs/deployment/android
https://cloud.tencent.com/developer/article/1661684
I am doing a fresh installation of Commercial Qt on a new MacOS Sierra machine. I am trying to build a sample Qt app for android & iOS. I am able to build my QtApp for iOS without any trouble.
But on android I get the following error:
Buildfile: build.xml does not exist!
Build failed
Building the android package failed!
-- For more information, run this command with --verbose.
19:47:50: The process "/Users/MyComputer/Qt/5.7/android_armv7/bin/androiddeployqt" exited with code 14.
Error while building/deploying project t1 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"
I have downloaded latest ndk r14b from here.
I have installed latest sdk that comes with Android Studio these days from here. And updated android sdkmanager to installed all platforms ranging from android-19 to android-25.
I have installed latest JDK 8 as well. I tested the android setup by building & running an android app from Android Studio which worked flawlessly.
Qt worked with Android pretty nicely. What has changed ? Should I do some tweaks because of some structural changes in Android ?
Copying PathToAndroidStudio/templates into PathToAndroidSDK/templates or PathToAndroidSDK/tools/templates as suggested here & here doesn't seem to be enough.
What more should I do apart from copying the templates folder as suggested in some other answers ?
You are trying to use Ant build system. Change it to using Gradle-based one or take a look here: The ant/ folder is suddenly missing from Android SDK. Did Google remove it?
Basically, there are armeabi-v7a and x86 built under the following path.
\android\build\intermediates\exploded-aar\org.xwalk\xwalk_core_library\16.45.421.19\jni\
I'd like to know how can I build arm64-v8a and x86_64 under this path.
I run cordova build android to build the project.
According to the cordova-plugin-crosswalk-webview readme you can use
cordova build android --xwalk64bit
I'm using Worklight Studio Developer Edition plugin for the Eclipse IDE Juno JAVA EE to test building hybrid apps and I'm trying to build and deploy to an Android MIPS based device. ARM devices and emulators work fine but the MIPS device will not install.
I receive the following errors from the console and logcat.
[2013-03-05 00:27:36 - Project1App1Android] Installation failed due to invalid APK file!
[2013-03-05 00:27:36 - Project1App1Android] Please check logcat output for more details.
[2013-03-05 00:27:36 - Project1App1Android] Launch canceled!
03-05 00:28:18.607: W/PackageManager(90): Native ABI mismatch from package file
I think the problem is the build is not including MIPS support for older device SDKs like Froyo 2.2.1 which is on the devce I'm having problems with. How can I configure Worklight to build for ARM and older MIPS? I have the MDS Eclipse plugin for PhoneGap installed as well and it builds and deploys to the same MIPS device without any problems.
Android applications are built and run with help of Android Development Tools. The unified support for all processor architectures is included in Release 21 of Android SDK. You can read the announcement here: Official Android SDK, Installation instructions
This is outside of the Worklight scope. You should open the Android SDK Manager, and make sure to install any support by Google related to MIPS and/or ARM.
The generated .apk is generated via Google's Android Developer Tools.