Unable to compile on QT for Android - android

I am new to QT programming and am trying to build a simple program on Android. I have installed QT 5.8, latest Android SDK, NDK and apache ant, but it gives the same error. I searched about this issue and tried using older versions of QT(5.5.1 and 5.7.0) , Android SDK as well as NDK, but its not helping. I tried giving the build path a shorter name, removed all the folders which had spaces in the title and reinstalled everything. Please help.
Error 1
11:40:56: The process "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" exited normally.
11:40:56: Starting: "C:\Qt\Qt5.7.0\5.7\android_armv7\bin\androiddeployqt.exe" --input C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-libcalqlatr.so-deployment-settings.json --output C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-build --deployment bundled --android-platform android-25 --jdk "C:/Program Files/Java/jdk1.8.0_131" --ant E:/Android/apache-ant-1.9.6/bin/ant.bat
Generating Android Package
Input file: C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-libcalqlatr.so-deployment-settings.json
Output directory: C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-build/
Application binary: C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/libcalqlatr.so
Android build platform: android-25
Install to device: No
Application binary is not in output directory: C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-build//libs/armeabi-v7a/libcalqlatr.so. Please run 'mingw32-make install INSTALL_ROOT=C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-build/' first.
11:41:09: The process "C:\Qt\Qt5.7.0\5.7\android_armv7\bin\androiddeployqt.exe" exited with code 7.
Error while building/deploying project calqlatr (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.7.0))
When executing step "Build Android APK"
11:41:09: Elapsed time: 01:15.

Check for build.xml in your output path
C:/Qt/Qt5.7.0/Examples/Qt-5.7/quick/demos/build-calqlatr-Android_for_armeabi_v7a_GCC_4_9_Qt_5_7_0-Debug/android-build/
and also check
TEMPLATE = app
in your pro file if this is not there append this.

Related

Can't able to run react native application on android device

Im Using MacBook Pro.. Im New To React Native.. After Creating An Project Im Running On iOS Device It's Running.. At The Same Time While I'm Running On Android Device Means Im Getting This Error.. Any One Please Help Me To Resolve This Error.. Im Using Visual Studio Code IDE For React Native Application
Thanks In Advance..
Error Details :
[Info] local.properties file doesn't exist. Using Android SDK location from PATH.
[Info] Starting React Native Packager.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
/bin/sh: adb: command not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* Where:
Settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'
* What went wrong:
Could not compile settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'.
startup failed:
General error during semantic analysis: Unsupported class file major version 57
So you have two errors to fix here as your error log
local.properties file doesn't exist.
Failed to launch the emulator
local.properties file issue fixing
Open your react native project android folder using Android Studio.
Wait for gradle sync and clean the project and rebuild it using Android Studio
After that make sure you have local.properties file is been created inside android folder
If not try these steps to make local.properties file manually
Right click top level of project and Create new file 'local.properties' then add: sdk.dir=/Users/<YourUsername>/Library/Android/sdk
Clean and build
Before running your react native project on android make sure you have turn on the Android Emulator by AVD Manager in Android Studio
If you have not create any emulators then try this link - I have posted full answer on how to make Android Emulator -
React native failed to launch emulator
EDIT :
For adb error you need to install adb drivers on you Mac
Follow these steps
First install Homebrew using this command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
or this command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that install adb using homebrew
brew cask install android-platform-tools
Try to re run

How to create Android App with Cordova 3.4

Since yesterday, I have some problems with Cordova and Android. I can not create an functional Android App. iOS works.
In detail: I use a Mac (MacOS X 10.8.5) and have installed ADT 22.6.2 (with API 17/18/19) and added the sdk-tools to my PATH.
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/adt/sdk/tools:/Applications /adt/sdk/platform-tools:/usr/local/MacGPG2/bin
My configuration:
$ node -v
v0.10.26
$ cordova -v
3.4.1-0.1.0
$ ant -version
Apache Ant(TM) version 1.8.2 compiled on June 20 2012
My attempt to create an Cordova App:
$ cordova create XY com.wb.XY XY
Creating a new cordova project with name "XY" and id "com.wb.XY" at location "/.../XY"
$ cd XY
XY wb$ cordova platform add ios
Creating ios project...
XY wb$ cordova platform add android
Creating android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.wb.XY
Name: XY
Android target: android-19
Copying template files...
Running: android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib"
Resolved location of library project to: /.../XY/platforms/android/CordovaLib
Updated and renamed default.properties to project.properties
Updated local.properties
No project name specified, using Activity name 'XY'.
If you wish to change it, edit the first line of build.xml.
Added file platforms/android/build.xml
Added file platforms/android/proguard-project.txt
Updated project.properties
Updated local.properties
No project name specified, using project folder name 'CordovaLib'.
If you wish to change it, edit the first line of build.xml.
Added file platforms/android/CordovaLib/build.xml
Added file platforms/android/CordovaLib/proguard-project.txt
Project successfully created.
XY wb$ cordova platform list
Installed platforms: android 3.4.0, ios 3.4.1
Available platforms: amazon-fireos, blackberry10, firefoxos
XY wb$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
Fetching plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git" via git clone
Installing "org.apache.cordova.inappbrowser" for android
Installing "org.apache.cordova.inappbrowser" for ios
XY wb$
What is going wrong? There is no directory „gen“.
If I try to import the project into ADT/Eclipse, I got the message:
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'XY'.
Errors running builder 'Android Pre Compiler' on project 'XY'.
Path must include project and resource name: /XY
and
/XY/gen already exists but is not a source folder. Convert to a source folder or rename it.
Eclipse generates a folder called „gen“, but it is empty.
EDIT: Here is what I tried based on the input given in answers and comments:
I have installed Node.js and Cordova 3.4:
$ node -v
v0.10.26
$ cordova -v
3.4.1-0.1.0
$ ant -version
Apache Ant(TM) version 1.8.2 compiled on June 20 2012
I have done this as you described with CLI.
The Android SDK is in the system path:
$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/adt/sdk/tools:/Applications/adt/sdk/platform-tools:/usr/local/MacGPG2/bin
Everything seems to be all right. Do you see any mistake? Do I need Apache Ant?
If I try to add android (without sudo), I have got the output shown in my question. Trying this as admin (with sudo), the result is the same.
With
$ cordova emulate android
I get:
...
BUILD SUCCESSFUL
Total time: 5 seconds
WARNING : no emulator specified, defaulting to Android_Tablet
Waiting for emulator...
2014-04-26 14:16:53.848 emulator64-arm[84081:f07] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
emulator64-arm: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
Booting up emulator (this may take a while)........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
It takes a very long time . . . after 15 minutes I broke off. The log at Eclipse shows always returning the same messages.
But with
$ cordova run android
I am able to install and launch the app on my Android-device. But if I try to import the project into Eclipse, the file XY.java is shown with many errors.
Do you have any idea what could be the problem?
I am still able to work with my existing apps (iOS and Android), but I can not create a new one for Android.
I am sharing with you the steps to create android PhoneGap app with cordova 3.4 version :-
1) Download and install Node.js.
2) Run this command on your terminal :-
$ sudo npm install -g cordova
3) Then create your project using following command :-
$ cordova create hello com.example.hello HelloWorld
4) Then before adding any platform , run the following command....Replace the path of android sdk with your system path :-
$ export PATH=${PATH}:/Users/taruna/Documents/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:/Users/taruna/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools
5) Now add your platform using following command :-
$ sudo cordova platform add android
6) Now you can successfully run your project on emulator using following command :-
$ cordova emulate android
And its done now.
`

Can't get QtCreator to deploy to android emulator

I'm running following setup:
Ubuntu 13.10 64bit
Qt creator 3.0.1
Qt 5.2.1
NDK r9d 64bit
adt-bundle-linux-x86_64-20140321.zip
I managed get it compile. I started emulator before deploying the app. but instead of sending the apk to running emulator it started a new one... Qt Create went not responding for a while...new emulator got booted up and after a while Qt createor started to respond again and returned following compile output.
Also I tried to get it working on Windows 7 64bit before Ubuntu but the result was very same. Also I believe the software versions were mostly same.
17:11:12: Removing directory /home/rikko/android/projects/build-omgFrickingGosh-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Debug/android-build
17:11:12: Starting: "/usr/bin/make" INSTALL_ROOT=/home/rikko/android/projects/build-omgFrickingGosh-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Debug/android-build install
cp -f -R /home/rikko/android/projects/omgFrickingGosh/qml/omgFrickingGosh /home/rikko/android/projects/build-omgFrickingGosh-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Debug/android-build/assets/qml/
install -m 755 -p "libomgFrickingGosh.so" "/home/rikko/android/projects/build-omgFrickingGosh-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Debug/android-build/libs/armeabi-v7a/libomgFrickingGosh.so"
17:11:13: The process "/usr/bin/make" exited normally.
Error while building/deploying project omgFrickingGosh (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Deploy to Android device'
17:13:26: Elapsed time: 02:14.</code>
I actually maanged to get it runningun Windows.
Seems that most probablt the suspects are new SDK or NDK.
So the configuration that is currently working on 64bit Win 7 is followng:
JDK: jdk-7u51-windows-x64.exe
Ant: apache-ant-1.9.2-bin.zip
NDK: android-ndk-r9-windows-x86_64.zip
SDK: adt-bundle-windows-x86-20131030.zip (contains SDK manager 22.3)
Qt 5.2.1 and QtCreator 3.0.1 both from qt-opensource-windows-x86-1.5.0-2-online.exe
Contact me if you have similar problem and can't get your hands on these package versions yourself.

Qt 5.2 and Android Error

So after a few hours of struggling to set up my Qt so I can start with my first Android app I am still without luck.
I’ve gotten a VERY simple program (just to get all the settings right) to build properly but when I click the play button to run it, there is an error I cannot seem to solve. Here is the complete output when I press play:
22:16:45: Running steps for project Androidtest...
22:16:45: Configuration unchanged, skipping qmake step.
22:16:45: Starting: "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
22:16:48: The process "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
22:16:48: Starting: "mingw32-make" INSTALL_ROOT="D:\\RundownRiot\\Androidtest\\build- Androidtest-Android_for_arm_GCC_4_6_Qt_5_2_0-Debug\\android-build" install
qtcreator_ctrlc_stub: Command line failed: mingw32-make INSTALL_ROOT="D:\\RundownRiot\\Androidtest\\build-Androidtest-Android_for_arm_GCC_4_6_Qt_5_2_0-Debug\\android-build" install
22:16:48: The process "mingw32-make" exited with code -1.
Error while building/deploying project Androidtest (kit: Android for arm (GCC 4.6, Qt 5.2.0))
When executing step 'Copy application data'
22:16:48: Elapsed time: 00:03.
The error is in line 6.
I read that sh.exe might be in the path variable but I don’t think its there, here is the value for path:
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files\CineForm\Tools;C:\Program Files\QuickTime\QTSystem\;
C:\Program Files\Windows Live\Shared; C:\Program Files\Java\jdk1.7.0_51\bin;
C:\Android\AndroidSDK\sdk\tools;
C:\Android\AndroidSDK\sdk\platform-tools;C:\Program Files\Java\jdk1.7.0_51\bin;
C:\Qt\Qt5.1.1\5.1.1\mingw48_32\bin;
I am using win7 32bit, Qt5.2 and Qt Creator 3.0.1.
I found that I had more than 1 version of Qt installed. So I uninstalled Qt completely and only installed the latest version. That solved all my problems.

Deploying android app to phone : error: [install_itemfolder_01] Error 1 Windows

I’ve installed all components that I could possibly need,
I’ve been on the net for two days and I just can’t find an answer to this question.
I’ve checked my apache ant,
javac,
java JRE, JDK,
Qt Variables and everything is ok.
Qt likes all of my settings apart from when I try to deploy my app to emulator or device I get this error
Issues Output:
:-1: error: [install_itemfolder_01] Error 1
Compile Output :
17:54:43: Running steps for project Test...
17:54:43: Configuration unchanged, skipping qmake step.
17:54:43: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
17:54:45: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
17:54:45: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\\Users\\ryan\\Desktop\\Projects\\Qt c++\\build-Test-Android_for_armeabi_GCC_4_8_Qt_5_2_1-Release\\android-build" install
The system cannot find the path specified.
The system cannot find the path specified.
makefile:1716: recipe for target 'install_itemfolder_01' failed
mingw32-make: *** [install_itemfolder_01] Error 1
17:54:45: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Test (kit: Android for armeabi (GCC 4.8, Qt 5.2.1))
When executing step 'Copy application data'
Is there anyone who can help?
Thanks
I Fixed it.
For the love of life don't put any " " (Spaces) in your application path

Categories

Resources