Error in third party Library addition in qt android project - android

I am trying to add and android library to my qt android project. But it fails while deploying.
I followed steps as given in documentation : Third-party Android Libraries
I get the error
BUILD FAILED
E:\Installations\ADT\adt-bundle-windows-x86-20131030\sdk\tools\ant\build.xml:577:
../android-build/libs/ resolve to a path with no project.properties
file for project
E:\WorkSpaces\Qt\Qt_WidgetApps\AndroidSerialPortTrials\ThirdPartyLib\build-ThirdPartyLib-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_0_Android_GCC_arm_4_8-Debug\android-build
my project.properties
android.library.reference.1=../android-build/libs/
projectPath/android/
libs/
AndroidManifest.xml
project.properties
projectPath/android/libs/
- xx.so
- yy.jar
I tried
android.library.reference.1=libs/ as given in documentation
android.library.reference.1=../android/libs/
android.library.reference.1=./libs/
But all gives error

Related

Project with path ':spotify-app-remote' could not be found in project ':app'.?

I am developing android an app using Spotify SDK and I am following quick start guide
but when I have imported .aar and sync project I am getting the following error
A project with path ':spotify-app-remote' could not be found in project ':app'.
following image below my folder structure from android studio
You have to add include ':spotify-app-remote' in your settings.gradle file.

Compiling Hello-Jni failure in eclipse only when opening the hello-jni.c file in eclipse

I have been trying endlessly to build the sample HelloJni sample project for the Android NDK.
How I set up the environment:
I followed the instructions of the getting started in the docs: android-ndk-r10d\docs\Getting_Started/html/index.html:
Downloaded Eclipse Luna
Downloaded the Android SDK
Downloaded the Android NDK: android-ndk-r10d
Set the NDK installation folder in eclipse in preferences window -> android -> NDK.
Imported the hellp-jni sample.
Right click on the HelloJni Project -> Android tools -> Add native support.
Cleaned and Built the project.
Ran on my device the HelloJni library (not the tests)
And the app is running and everything is WORKING and I can see the generated .so file per architecture in the libs folder of the project (for every architecture, for example armebi, mips, etc...)
Here is a Print Screen showing everything is working:
Now here comes the strange part...
The Problem:
If I open the hello-jni.c file for editing or viewing in eclipse, I suddenly see compilation errors and I can't build and can't run the project anymore...
Here is a Print Screen showing that after i open the file, I suddenly get compilation errors:
What I have already tried but failed:
Adding the Android Native Nature, then removing it by:
Deleting the .project file,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.genmakebuilde,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
and removing the lines:
[nature]org.eclipse.cdt.core.cnature[/nature]
[nature]org.eclipse.cdt.core.ccnature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.managedBuildNature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.ScannerConfigNature[/nature]
removing the .cproject and all compiled files.
Then adding back the Android Native Nature.
According to this stackoverflow link:
Eclipse ADT - Unresolved inclusion jni.h
Failed
Once I got the error of (I am not getting it anymore): Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath". So I Googled and I changed the build settings to give the absolute path of my NDK installation folder:
According to this stackoverflow link:
Unable to launch cygpath in android
Here is a Print Screen:
Failed
Changing the Used tools from Android GCC Compiler to GCC C Compiler
according to this stackoverflow link:
Android NDK build, Method could not be resolved
Here is a Print Screen:
Failed
Copying an eclipse Luna installation from a friend that has the project working for him.
Failed
I have been spending hours on this and I couldn't find any solution to why this is happening.
PLEASE HELP
This is a common problem when you try to edit a C/C++ file inside a JAVA workspace/perspective without the proper configuration. You can simply select all the entries in the Error Log and delete them.
FWIW, Eclipse seems to have issues with the r10d version of Android NDK. See https://code.google.com/p/android/issues/detail?id=97023. I suggest you try r10c instead #worksforme :)

Google Player Game Service Error: Can't build the sample game

I can't build the sample game TypeANumberChallenge provided by Google (see GitHub). Got the following error message:
The project was not built since its build path is incomplete. Cannot find the class file for com.google.android.gms.games.GamesClient. Fix the build path then try building this project
The type com.google.android.gms.games.GamesClient cannot be resolved. It is indirectly referenced from required .class files MainActivity.java /TypeANumber/src/com/kerrywei/games/tanc
I did include the project library BaseGameUtils and google-play-services-lib as described by readme and Google Play Services Guides, but still got the error, and can't just compile...
Update:
I tried to remove TypeANumberChallenge and redo the whole process and got a new error when trying to add BaseGameUtils as library:
An internal error occurred during: "Android Library Update".
Path must include project and resource name: /BaseGameUtils
Problem solved by reading Google Play Services Guides
Make a copy of the Google Play services library project. Copy the library project at
<android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
to the location where you maintain your Android app projects. If you
are using Eclipse, import the library project into your workspace.
Click File > Import, select Android > Existing Android Code into
Workspace, and browse to the copy of the library project to import it.
You CANNOT use the lib project in SDK folder DIRECTLY...
What a joke..

library resolve to a path with no project.properties file

I'm having trouble building my project with Jenkins and referencing the Sherlock project library.
I can build the project with ant on my local system. The problem seems to be referencing the Sherlock library on the build server.
I pass an environment variable to ant with the relative path to the Sherlock library project:
android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library
I'm getting this error.
**BUILD FAILED**
/SDK/android-sdk-macosx/tools/ant/build.xml:595:
The following error occurred while executing this line:
/SDK/android-sdk-macosx/tools/ant/build.xml:571:
../../buildlibraries/androidlibraries/sherlock/library resolve to a path with
no project.properties file for project /Users/Jenkins/buildlibraries/androidlibraries/sherlock/library
I checked and a project.properties file does exist at that location.
It has these properties:
android.library=true
# Project target.
target=android-14
I had the same thing happen to me just now. I use both a Windows and Mac to develop with. I watne d to test my project on both platforms. It built just fine on my Windows machine, but broke on my Mac. When I looked at my project.properties in my Android application (not library projects) on the Mac, I saw that my library projects were referenced this way:
android.library.reference.1=LibraryProjects\\my_lib_project
I changed it to the line below, and it worked just fine!
android.library.reference.1=LibraryProjects/my_lib_project
I solved the issue by editing and checking in the project.properties file with the same property: android.library.reference.1=../../buildlibraries/androidlibraries/sherlock/library
I'm not sure why it works. Why would ant care if the property is passed in by Jenkins vs. declared in the project's property file?
Now I have two paths in my project.properties file: one for a local build and one for the build on Jenkins.
I had similar issue with error ../google-play-services_lib resolve to a path with no project.properties file for project. It has to work in Jenkins CI (Cloudbees), so no manual project.properties editing.
My solution was to replace android update lib-project --path ... with ugly but working echo "android.library.reference.1=../../../..$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib" >> project.properties in Jenkins shell command.
I had this problem because I hadn't downloaded the google play services package using the android tool. When I checked my android sdk directory ($ANDROID_HOME) there was no "$ANDROID_HOME/extras/google" folder.
I fixed this by running android and downloading "Google Play services" found in the extras section.

java.lang.IllegalArgumentException: already added: Lorg/jbox2d/callbacks/ContactFilter;

I have an android project and am trying to add JBox2D and added "jox2d-library-2.1.2.2.jar" as both a referenced library in Java Build Path|Libraries and via Android Dependencies and in both cases get the runtime error:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg/jbox2d/callbacks/ContactFilter;
I just don't understand why this is failing as there is only one instance of the JBox2D library jar added.
Has anyone else experienced this problem?
Each time before executing a run I perform a project clean.
Also, I have seen other Android developers have similar problems with different projects:
https://stackoverflow.com/questions/2680 ... ternal-jar
and I have tried their suggestions but with no luck.
Graham
if your ADT version 2.0 or higher lib file doesn t work.
Solution:
-Delete lib file
-Remove external jar file references from java build path
-Create libs file
-Copy jar file here(don't reference from java build path)
-Clean your project
Now it's ready for run

Categories

Resources