Develop for android java issues
-
@Phips04 said in Develop for android java issues:
I'm not sure, but maybe its not android itself being responsible for the problems.
Did you read the post from @jsulm ?
-
This post is deleted!
-
@Phips04 It does not matter at all what device you attach to your PC,
what does matter is what minimal android version you set inside your manifest. Did you change it there ?
-
This post is deleted!
-
@Phips04 said in Develop for android java issues:
Do you mean the *.pro file?
No, the Android manifest ==> AndroidManifest.xml
Double click on it in QtCreator to start the editor:
-
-
Java and android settings are ok, in the android settings there is no "ndk-bundle". But the second entry exists, as I mentioned OpenSSL is not set
-
@Phips04 said in Develop for android java issues:
in the android settings there is no "ndk-bundle"
This is your problem, ndk-bundle is mandatory for Qt!
Extract from the Qt documentation:
Use the sdkmanager command line tool to update the packages list and then install the essential packages:cd <ANDROID_SDK_ROOT>/tools/bin/ ./sdkmanager --update ./sdkmanager --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "ndk-bundle"
-
-
@Phips04 This seems to be a well know issue with Android:
- https://stackoverflow.com/questions/60730615/sdkmanager-warning-could-not-create-setting-java-lang-illegalargumentexcepti
- https://medium.com/@s89707192/if-you-have-the-issue-652c7c1ad5d0
You can try:
cd <ANDROID_SDK_ROOT>\tools\bin\ sdkmanager --sdk_root="<ANDROID_SDK_ROOT>" --update sdkmanager --sdk_root="<ANDROID_SDK_ROOT>" --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "ndk-bundle"
-
It worked this way, the bundle is installed now, but I still can't change the minimal android version
-
@Phips04 do it by hand than, open the android manifest.xml in a text editor
and change the version there
-
The .xml can be evaluated and I set the entries. Min sdk is 21 (android 5) and target is 27 (android 8.1). The error still is the same
-
@Phips04 said in Develop for android java issues:
It worked this way, the bundle is installed now, but I still can't change the minimal android version
What do you mean with "you can't"? Is the dropdown combobox grayed out or is the list empty?
Do you have restart Qt Creator after updating SDK root? -
Yes the combobox was grayed (I set the entries in the xml file via text editor, now I can edit the boxes) and I restarted Qt creator.
-
I meant qt Creator says Java settings are ok.
I didn't remember that version 8 is the recommended one, installed 15.
I will replace it by 8 now -
@Phips04 said in Develop for android java issues:
I didn't remember that version 8 is the recommended one, installed 15.
Yes, it is no clearly defined ==> https://doc.qt.io/qt-5/android-building.html.
JDK 8, still recommended for best compatibility, but starting with Qt 5.15 JDK 11 could be used.Side note: if you search on internet
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
, all matches you will found will clearly detail the issue. The gradle version is not compatible with the selected JDK.
For Qt 5.15, the used gradle version is 5.6.4 (just check in<QT_DIR>/5.15.0/android/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties
)
14/28