I am developing an android application using Qt.
I decided to migrate from Qt5 to Qt6 for the convenience of the project, but androiddeployqt.exe, a tool for deploying to Android, started to crash after migrating to Qt6.
"C:\Qt\6.2.4\mingw_64\bin\androiddeployqt.exe" --input ~/android-{packageName}-deployment-settings.json --output ~/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build --android- platform android-30 --jdk "C:/Program Files/Android/Android Studio/jre" --verbose --gradle
Generating Android Packages
Input file: ~/src/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-{packageName}-deployment-settings.json
Output directory: ~/src/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build/
Application binary: building
Android build platform: android-30
Install to device: No
Delete missing files ~/depend_android ~/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build/{packageName}
Delete missing files ~/depend_android ~/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build/{packageName}
Delete missing files ~/depend_android ~/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build/{packageName}
Delete missing files ~/depend_android ~/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build/{packageName}
Delete missing files ~/depend_android ~/build-Android_Qt_6_2_4_Clang_arm64_v8a/android-build/{packageName}
...
As shown in the above log, the same log output is looped infinitely and eventually crashes
I checked the source code under the Qt installation directory to solve the problem. (C:\Qt\6.2.4\Src\qtbase\src\tools\androiddeployqt\main.cpp)
The cause of the loop seems to be that the parent directory of the specified Path is passed instead of the directory of the Path specified by the argument to deleteMissingFiles() of main.cpp L400.
As of Qt5, the specified Path was passed instead of the parent directory's Path. At least that's what the code in androiddeployqt/main.cpp looks like.
Qt6 androiddeploy qt/main.cpp L400
deleteMissingFiles(options, src.absoluteDir(), dst.absoluteDir());
Qt5 androiddeploy qt/main.cpp L386
deleteMissingFiles(options, src.absoluteFilePath(), dst.absoluteFilePath());
I would like to ask people who are developing using Qt6 and androiddeployqt.exe. How do you work around this issue?
Related
I have a very basic question about enabling ensime in .java files inside android project (basically its what suppose to be enjine mode as I understood) from emacs.
So I added plugin { id 'org.ensime.gradle' version '0.2.8' } inside my build.gradle in root of my android project, generated .ensime file in project root and after invoking ensime from inside emacs with MainActivity.java file opened - it started ensime server successfully, and changed .java file major mode to ensime Disconnected. But no matter what I do looks like I can not connect to running server.
A also tried to generate new android blank project from scratch with sbt and sbt gen-android and tried to run inside that project root folder sbt ensimeConfig and sbt ensimeConfigProject - no difference, main.scala after enabling ensime-mode in it works great, if I try to enable ensime-mode in some .java file from that project, like MainActivityTest.java - the same as described upper - disconnected and no ensime functionality.
Ok, looks like I found answer - its basically duplication of this. All what needed to do is to add :compile-jars (" [...] /local/share/java/android-sdk-mac_x86/platforms/android-10/android.jar") to .ensime file.
I am using j2objc to compile and use a java library in iOS. I followed the processes:
http://j2objc.org/docs/Xcode-Build-Rules.html
http://j2objc.org/docs/Required-Link-Flags.html
I do not get any build errors until I start importing the header files to use them:
#import "org/library/Class.h"
The files are not found. What I am missing?
On the other hand, I tried to use the manually translated library files (using the terminal j2objc commands). If I pùt the .h and .m files into the j2objc-dist/include folder they are recognized by the editor and I can use the classes without compile errors. But, when I try to build the project it finds errors of the type _OBJ_CLASS_$_Java. I tried to include the files to the compile list in Xcode and I verified the path of libjre_emul.a but I still get the error.
My library contains packages so it has multiple folders in a tree.
My preference will be to use the first method (original Java sources)
DATA FOR JAVA SOURCES CASE:
Build rules:
Java source files
Custom script:
/Users/xgibert/Desktop/Orekit_iOS/j2objc-dist/j2objc -d ${DERIVED_FILES_DIR} -sourcepath ${PROJECT_DIR}/src/ ** \ --no-package-directories ${INPUT_FILE_PATH};
Output files:
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.m
Build phases
Link Binary with libraries:
libicucore.dylib
Security.framework
libz.dylib
Build Settings
Linking - Other Linker Flags:
-ljre_emul -L /Users/xgibert/Desktop/Orekit_iOS/j2objc-dist/lib -force_load /Users/xgibert/Desktop/Orekit_iOS/j2objc-dist/lib/libjre_emul.a -l jre_emul -ObjC
Search Paths - Library Seargh Paths:
/Users/xgibert/Desktop/Orekit_iOS/j2objc-dist/lib
Search Paths - User Header Search Paths:
/Users/xgibert/Desktop/Orekit_iOS/j2objc-dist/include
My java library files are in Project_root/src. The tree looks like this:
root/
src/
org/
orekit/
data/
time/
...
apache/
...
In my ViewController.m file I try to import with the following line without success (file not found):
#import "org/orekit/data/DataProvidersManager.h"
Xcode assumes all sources are in a top-level directory, so imports such as you describe fail. As described in the Xcode-Build-Rules page, the --no-package-directories flag is needed, as it outputs all generated files to the specified build directory without sub-directories, and generates correct #import directives.
A sample project that demonstrates including Java sources with packages is j2objc-sample-reversi. Its UI sucks (I wrote it, sigh), but the game engine is decent; if you need a tougher opponent, crank up the engine strength here.
I'm trying to use R to hook the Java code from the GSRad project. The GSRad Java code is available online and comes as a One-Jar project jar (I was not familiar with One-Jar until today). I can run the One-Jar file just dandy using the following command (after unzipping the file from the above link):
java -jar gsrad_sample.jar
When I pop open the gsrad_sample.jar file I see a jar titled clima_GSRAD-1.0.0.jar in the /lib/ directory which contains the class files I want to hook with R. I've pulled out the jar of my affection and tried the following, to no avail:
library(rJava)
.jinit()
.jaddClassPath( "/home/jal/Documents/DSSAT/gsrad/clima_GSRAD-1.0.0.jar" )
.jnew( "cra/clima/gsrad/GSRBristowCampbellStrategy" )
Any tips on how I might hook the classes inside the clima_GSRAD-1.0.0.jar? I'm flummoxed.
EDIT
The GSRad site requires registration which is annoying. The full zip file which contains the Doxygen documentation for the Java package as well as the One-Jar jar file is available here and if you pop that open the jar that has the classes I want to hook is this one.
Let me preface my answer by saying that I'm no expert in Java / rJava, so apologies if this isn't 100% correct. I hope it's a step in the right direction though.
Start by unzipping gsrad_sample.jar to C:/gsrad (or adjust your paths based on where you unzip it). Then add all the contents of C:/gsrad/lib to your class path:
library(rJava)
.jinit()
.jaddClassPath(dir( "C:/gsrad/lib", full.names=TRUE ))
.jclassPath()
.jnew( "cra/clima/gsrad/GSRBristowCampbellStrategy" )
I created lib for my blackberry java app (jar file). But it isn't work.
com.myapp.MyManager: Error!: Missing stack map in: getInstance at label: 31
What is this?
If i copy package of my lib to my blackberry app, it works well. But I need have lib.
You need to preverify the jar file manually. you can do the following to preverify the jar.
execute the following command:
preverify -classpath "JDE_PATH_HERE\lib\net_rim_api.jar" "your_jar_filename"
Read more: http://getablogger.blogspot.com/2009/09/how-to-include-external-jar-file-in.html#ixzz1iTh6g1SF
You can try this link as well .It has instructions on how to do it.
I am using ant-release to do a 1-step build of my Android app.
My build.properties looks like this:
application.package=xxxxx
key.store=sonr
key.alias=sonr labs
key.store.password=xxxx
key.alias.password=xxxx
When I run ant-release everything is fine except for application signing. I get the error:
-release-prompt-for-password:
-release-nosign:
[echo] No key.store and key.alias properties found in build.properties.
[echo] Please sign /Users/syalam/Documents/git/joeborn-sonr/sonr/bin/SONR-release-unsigned.apk manually
[echo] and run zipalign from the Android SDK tools.
[propertyfile] Updating property file: /Users/syalam/Documents/git/joeborn-sonr/sonr/bin/build.prop
[propertyfile] Updating property file: /Users/syalam/Documents/git/joeborn-sonr/sonr/bin/build.prop
[propertyfile] Updating property file: /Users/syalam/Documents/git/joeborn-sonr/sonr/bin/build.prop
[propertyfile] Updating property file: /Users/syalam/Documents/git/joeborn-sonr/sonr/bin/build.prop
How can I resolve this?
PS. I followed this tutorial for getting my build process down http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html
I had this problem too recently, I think that that tutorial is out of date...
The key.alias etc directives need to be in a file named ant.properties. There's no file called build.properties any more.
Ultimate answer of any this kind of question is in android-sdk/tools/ant/build.xml
Document is at http://developer.android.com/guide/developing/building/building-cmdline.html
regarding 'Sheehan Alam' issue that follows file name fix
[signjar] jarsigner error: java.lang.RuntimeException: keystore load: ...
You probably have key.store set to a value with a full path.
Make sure that you are using '/' and not '\'.
Is keystore the name of your keystore file? From the tutorial:
Where keystore is the name of your keystore file and change the value
of key.alias to your keystore's alias. Now when you run ant release,
you will be prompted for your passwords, and the build will
automatically sign and zipalign your package.
In your example above, you're using the same value for both key.store and key.alias.
The only other potential discrepancy I can see is that -release-nosign: is referencing build.properties when looking for key.store and key.alias, but referencing build.props later on.
I'm not an Andriod developer, so the best I can do is be a second pair of eyes; sorry.
If you already have a project that you'd like to add the Ant build script to, then there is an easy command line tool you can use. Open up a command prompt and navigate to the base directory of your project. From there, use the command:
android update project --path .
add "<"property file="build.properties" /">"
in your build.xml at the project folder.