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?
Related
I create KMM(Kotlin multiplatform mobile) project using Android studio 4.1 RC3 and try to run the iOS App (with default code) but stuck with following error:
error : The linked and embedded framework 'shared.framework' is
missing one or more architectures required by this target: arm64. (in
target 'iosApp' from project 'iosApp')
But when I just hit 'build', it get built successfully. Only happening only when hit 'run' from Android studio. Mean while I used Xcode to run the same project and face no issues getting it deployed into the simulator successfully.
By the way I was following this official KMM guide
https://kotlinlang.org/docs/mobile/create-first-app.html
Using Xcode 14 ( I tried simulators with iOS14,13.5,12.1) using Mac OS Catalina 10.15.6
This problem is most probably caused by Xcode 12 adding new simulator architectures. As a workaround, one can try adding arm64 to the Disable Architectures list in Build Settings. See the related issue here
When I tried to build QtFireExample with my QtCreator, failed with below error message.
The installed SDK tools version (26.1.1) does not include Gradle
scripts. The minimum Qt version required for Gradle build to work is
5.9.0/5.6.3 Error while building/deploying project QtFirebaseExample (kit: Android) When executing step "Build Android APK"
My android studio is 3.2.1. And SDK tools 26.1 is also installed.
qt version is also above 5.9.0
What I did mistake?
❯ qmake --version
QMake version 3.1
Using Qt version 5.12.0 in /usr/local/Cellar/qt/5.12.0/lib
There's more steps to follow before you can deploy your first Android app using QtCreator. Installing SDK tools is not enough. Here is what I did, I'm using Windows, but hopefully the steps are the same under Ubuntu.
Install QtCreator using the link provided by Hitokage, include QtCreator (I got version 4.8.0), and Qt 5.12.0 binaries for your platform + needed Android (armv7, x86...)
Get JDK 1.8.X.X
Get NDK r18b (or a more recent version)
Get SDK tools 26.1.1 (what you already did)
SDK tools itself is not enough, some SDK modules must be installed, from SDK tools folder, run:
sdkmanager platform-tools
sdkmanager build-tools;28.0.3
sdkmanager extras;google;usb_driver
sdkmanager platforms;android-22 (which is enough for me, you may want something different based on your target Android devices)
Then open QtCreator, Go to "Mobile devices" (my french version calls it "Appareils mobiles"), then make it point to installed JDK, SDK, NDK, clic Apply and then kits should be automtically created. Now you are ready to compile and deploy and Android app for API 22.
Note that gradle is automatically downloaded by QtCreator first time you'll request a deployment.
I have tried downgrading the SDK Tools which didn't work. What worked for me however was downloading the official QT installer (working on Linux), installed QT to a new directory along with ARM64-v8a and ARMv7 (which probably solved the problem, I didn't have that in the package I installed from Arch repo). Now I can (after allowing the developer and debug mode on the device) deploy the app on the phone.
EDIT: Then chose one of those auto-detected kits.
What is a working combination of versions of the development tools if I want to develop C++ Qt Android apps? I tried several combinations but they all fail with strange build errors of a simple Hello World test app.
Currently, I have
Qt Creator 4.2.1 (based on Qt 5.8.0, MSVC 2015, 32bit)
JDK 10.0.1
Android SDK 24.4.1-win
Android NDK r10e
Apache ant 1.9.11
but e.g. that fails with
Buildfile: build.xml does not exist!
Build failed
Warning: Android platform 'android--1' does not exist in SDK.
Building the android package failed!
-- For more information, run this command with --verbose.
21:35:44: Der Prozess "C:\EigeneDateien\bin\Qt-5.8.0\5.8\android_armv7\bin\androiddeployqt.exe" wurde mit dem Rückgabewert 14 beendet.
I want to use an open source version.
Please, give a list of tools with correct version numbers and maybe download links.
The good procedure is to use Qt's online installer (https://www.qt.io/download-qt-installer), get the latest version of QtCreator/Qt, then the latest version of ndk/sdk/jdk and cross your fingers because it does not always work...
I fighted a bt with this in early 2019 and here is a combination that perfectly works for me since then, under Windows 7 and 10.
QtCreator 4.8.0, based on Qt 5.12.0. I got it from the online installer by then and archived it, but you can apparently specifically download it from here.
NDK r18b
JDK 1.8.0_201, can be dowaloaded from this page (find jdk-8u201-windows-x64.exe)
Android SDK command line tools "sdk-tools-windows-4333796", available here. Then used sdkmanager to download API platform-tools and android-28. Try sdkmanager "platform-tools" "platforms;android-28"
No need for ant anymore, QtCreator will download and use gradle silently.
i want to use Apache Cordova in visual studio 2013.
I followed the instructions on installing Apache tools manually from this
When i create new project with Template apache cordova app get this error:
1-Android package
I installed latest the Android SDK with the following package:
2-WebSocket4Net
I Downloaded WebSocket4Net(0.9).Binaries.zip from CodePlex
and installed visual studio in drive D :
D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\WebClient\Diagnostics\ToolWindows
then copied WebSocket4Net.dll to ToolWindows folder
Seems you alreay have the required component installed.
It might be a false alarm by the visual studio dependency checker. Actually, I have some warnings as well, but everything works well. If you did not encounter any problem during building app, feel free to ignore the warning. WebSocket4Net is only required for win7 and if ripple works well, leave it there.
P.S. don't upgrade Android 24.3.2 for now, because there is a known issue that will cause build fail when trying deploy on Android device and android emulator.
I'm on iMac with X.8.3 and i'm trying to make my test application working with Titanium Studio and Android SDK 2.2, the apps works on iPhone Simulator but not on Android.
Here is the terminal error when trying to execute the app in Android Emulator
"[INFO] logfile = /Users/*****/Documents/Titanium_Studio_Workspace/Geocoder/build.log
[ERROR] : Build process exited with code 1
[ERROR] : Project failed to build after 208ms
[ERROR] : Emulator process exited with code 1"
and the log file says the same.
I've tried the android emulator with Eclipse and it works pretty well!
On the Dashboard page of Titanium Studio the icon of Android SDK stay in Red, it says
"Android configuration details.
One or more pieces are missing from the Android SDK. It may be that the Android SDK is already installed and Titanium Studio cannot locate the directory, or it may be that some additional components need to be installed.
Items required:
An Android SDK is missing. Titanium requires Android platform 2.2.*
Add-On Google APIs version 8"
I've already tryied to remove and install it all 2 times and it doesn't change anything.
In the preferences of Titanium / Studio / Plateforms / Android it's seems to be Ok with the android sdk, the dropdown android sdk sees 3 versions of android 4.2.2 and Google API.
I just had the same problem while trying to start the Kitchen Sink app. In my case the problem was that tiapp.xml referred to and Android SDK that was not installed on my machine.
I changed the SDK version number in these lines from 11 to 14
<uses-sdk android:targetSdkVersion="14"/>
<tool-api-level>14</tool-api-level>
Another possible option would be to install the SDK version that is called in tiapp.xml.
Answer 1 :
Seems build tools got moved to another directory with the latest Android SDK update. Created symlinks to aapt and dx in /Applications/Android-sdk/platform-tools:
ln -s /Applications/Android-sdk/build-tools/17.0.0/aapt aapt ln -s /Applications/Android-sdk/build-tools/17.0.0/dx dx
This solved it for me (after some digging in their Python code).
Answer 2 :
I'm on windows so i used mklink. I had to add a link to lib/dx.jar for it to work. What I dit was first add folder 'lib' to platform-tools folder and after in command line:
cd %YOUR_ANDROID_DIR%\platform-tools
mklink aapt.exe ..\build-tools\android-4.2.2\aapt.exe
mklink dx.bat ..\build-tools\android-4.2.2\dx.bat
cd lib
mklink dx.bat ..\..\build-tools\android-4.2.2\lib\dx.jar
Answer 3 :
I copied the following files:
C:\Android\build-tools\17.0.0\aapt.exe to C:\Android\platform-tools\aapt.exe
C:\Android\build-tools\17.0.0\dx.bat to C:\Android\platform-tools\dx.bat
C:\Android\build-tools\17.0.0\lib to C:\Android\platform-tools\lib
I then cleaned the project and rebuilt and everything is now working.
Source here: http://developer.appcelerator.com/question/152497/titanium-sdk-310-error-typeerror-argument-of-type-nonetype-is-not-iterable-on-building-android-app#comment-175782
Edit your emulator so that the Target is set to Google APIs for the level you want to use.
If this happens with Kitchen Sink demo, the fix is to go into the Android SDK Manager and install "Android 3.0 (API 11)". Make sure the app uses emulator "Google APIs (Android 2.3.3)" and "WVGA854". I assume there's a Titanium bug because you have to install a higher API level (3.0) than is actually used (2.3.3).