Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Oct 8, 2023

On the master branch @ d2b8c5e, building the apk target fails:

$ make -C src/qt apk
...
> Task :compileDebugJavaWithJavac FAILED
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:690: error: cannot find symbol
                Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                                                                              ^
  symbol:   variable R
  location: class VERSION_CODES
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:692: error: cannot find symbol
                        : m_activity.getDisplay();
                                    ^
  symbol:   method getDisplay()
  location: variable m_activity of type Activity
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:833: error: cannot find symbol
        float refreshRate = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                                                                        ^
  symbol:   variable R
  location: class VERSION_CODES
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:835: error: cannot find symbol
                : m_activity.getDisplay().getRefreshRate();
                            ^
  symbol:   method getDisplay()
  location: variable m_activity of type Activity
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtLayout.java:95: error: cannot find symbol
        Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                                                                      ^
  symbol:   variable R
  location: class VERSION_CODES
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtLayout.java:97: error: cannot find symbol
                : ((Activity)getContext()).getDisplay();
                                          ^
  symbol:   method getDisplay()
  location: class Activity
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/ExtractStyle.java:418: error: cannot find symbol
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
                                                           ^
  symbol:   variable Q
  location: class VERSION_CODES
/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/ExtractStyle.java:421: error: cannot find symbol
                numStates = stateList.getStateCount();
                                     ^
  symbol:   method getStateCount()
  location: variable stateList of type StateListDrawable
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
8 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 827ms
...

Fixing it by updating the Gradle tool's properties.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 8, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK fanquake

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@hebasto
Copy link
Member Author

hebasto commented Oct 8, 2023

Friendly ping @icota @johnny9 :)

This change fixes the `apk` target build after bumping Qt version from
5.15.5 to 5.15.10.
@hebasto hebasto changed the title Set minimum supported ANDROID_API_LEVEL to 31 Adjust Gradle properties Oct 8, 2023
@hebasto hebasto changed the title Adjust Gradle properties Adjust Gradle properties to fix apk build Oct 8, 2023
@hebasto
Copy link
Member Author

hebasto commented Oct 8, 2023

Reworked. The PR description has been updated.

@maflcko maflcko added this to the 26.0 milestone Oct 8, 2023
Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 5f50406 - seems fine.

@fanquake fanquake merged commit 66f8ee2 into bitcoin:master Oct 9, 2023
@hebasto hebasto deleted the 231008-android branch October 9, 2023 14:39
@maflcko
Copy link
Member

maflcko commented Oct 9, 2023

It still fails for me with the same reason in CI:

https://cirrus-ci.com/task/6379161720193024?logs=ci#L4214

@hebasto
Copy link
Member Author

hebasto commented Oct 9, 2023

It still fails for me with the same reason in CI:

cirrus-ci.com/task/6379161720193024?logs=ci#L4214

Does the CI task fail locally for you?

@maflcko
Copy link
Member

maflcko commented Oct 9, 2023

Yes.

Does MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_android.sh" ./ci/test_run_all.sh pass?

@hebasto
Copy link
Member Author

hebasto commented Oct 9, 2023

Yes.

Does MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_android.sh" ./ci/test_run_all.sh pass?

For me, the following

env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'MAKEJOBS="-j16" FILE_ENV="./ci/test/00_setup_env_android.sh" ./ci/test_run_all.sh'

passes for 66f8ee2, but fails for f467444.

@maflcko
Copy link
Member

maflcko commented Oct 10, 2023

The task https://cirrus-ci.com/task/6379161720193024?logs=ci#L4214 isn't using volumes/caches, so f467444 is irrelevant for this task.

passes for 66f8ee2, but fails for f467444.

Did you clear all caches?

@maflcko
Copy link
Member

maflcko commented Oct 10, 2023

Steps to reproduce on a fresh Jammy VM: (:warning: mode):

git checkout 66f8ee2 && DANGER_RUN_CI_ON_HOST="1" MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_android.sh" ./ci/test_run_all.sh

@maflcko
Copy link
Member

maflcko commented Oct 10, 2023

Steps to reproduce on a fresh install of podman (normal CI mode):

git checkout 66f8ee2 && MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_android.sh" ./ci/test_run_all.sh

@hebasto
Copy link
Member Author

hebasto commented Oct 10, 2023

@maflcko

Does the following patch:

--- a/ci/test/01_base_install.sh
+++ b/ci/test/01_base_install.sh
@@ -98,7 +98,7 @@ if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then
   fi
   mkdir -p "$ANDROID_HOME"
   unzip -o "$ANDROID_TOOLS_PATH" -d "$ANDROID_HOME"
-  yes | "${ANDROID_HOME}"/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_HOME}" --install "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platform-tools" "platforms;android-${ANDROID_API_LEVEL}" "ndk;${ANDROID_NDK_VERSION}"
+  yes | "${ANDROID_HOME}"/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_HOME}" --install "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platform-tools" "platforms;android-31" "platforms;android-${ANDROID_API_LEVEL}" "ndk;${ANDROID_NDK_VERSION}"
 fi
 

work for you?

(clear cache may be needed)

@maflcko
Copy link
Member

maflcko commented Oct 10, 2023

If it works for you on a fresh install of the operating system, it should also work for me. Otherwise, we'll have to debug something else.

fanquake added a commit that referenced this pull request Oct 12, 2023
78d3062 ci: Install Android API 31 platform as Qt expects (Hennadii Stepanov)

Pull request description:

  When building the `qt` package, it expects that the default (in Qt's view) Android API platform is installed.

  During the recent Qt version [update](#28561), it has been changed:
  ```diff
  --- a/mkspecs/features/android/sdk.prf
  +++ b/mkspecs/features/android/sdk.prf
  @@ -1,6 +1,6 @@
   API_VERSION_TO_USE = $$(ANDROID_API_VERSION)
   isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION
  -isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-28
  +isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-31

   ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
   !exists($$ANDROID_JAR_FILE) {
  ```

  This PR fixes the CI for the Android task and addresses #28561 (comment).

  Qt [docs](https://doc.qt.io/qt-5/android.html) still claim that Android API Level 21 and up are supported, however, I did not test every possible configuration.

  NOTE: #28611 is still valid.

ACKs for top commit:
  maflcko:
    lgtm ACK 78d3062
  jarolrod:
    tACK 78d3062

Tree-SHA512: 781fba6d80aae7e6500854de14af0d30169c258e395b9e482a5430a7b4a2211a6181f8c9ee58543c896b431abf09e3e7c5573b9672ed128658f11f98a2006e7e
Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Oct 13, 2023
5f50406 Adjust Gradle properties (Hennadii Stepanov)

Pull request description:

  On the master branch @ d2b8c5e, building the `apk` target fails:
  ```
  $ make -C src/qt apk
  ...
  > Task :compileDebugJavaWithJavac FAILED
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:690: error: cannot find symbol
                  Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                                                                                ^
    symbol:   variable R
    location: class VERSION_CODES
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:692: error: cannot find symbol
                          : m_activity.getDisplay();
                                      ^
    symbol:   method getDisplay()
    location: variable m_activity of type Activity
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:833: error: cannot find symbol
          float refreshRate = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                                                                          ^
    symbol:   variable R
    location: class VERSION_CODES
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:835: error: cannot find symbol
                  : m_activity.getDisplay().getRefreshRate();
                              ^
    symbol:   method getDisplay()
    location: variable m_activity of type Activity
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtLayout.java:95: error: cannot find symbol
          Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                                                                        ^
    symbol:   variable R
    location: class VERSION_CODES
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtLayout.java:97: error: cannot find symbol
                  : ((Activity)getContext()).getDisplay();
                                            ^
    symbol:   method getDisplay()
    location: class Activity
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/ExtractStyle.java:418: error: cannot find symbol
              if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
                                                             ^
    symbol:   variable Q
    location: class VERSION_CODES
  /home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/ExtractStyle.java:421: error: cannot find symbol
                  numStates = stateList.getStateCount();
                                       ^
    symbol:   method getStateCount()
    location: variable stateList of type StateListDrawable
  Note: Some input files use or override a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  8 errors

  FAILURE: Build failed with an exception.

  * What went wrong:
  Execution failed for task ':compileDebugJavaWithJavac'.
  > Compilation failed; see the compiler error output for details.

  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  * Get more help at https://help.gradle.org

  Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
  Use '--warning-mode all' to show the individual deprecation warnings.
  See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

  BUILD FAILED in 827ms
  ...
  ```

  Fixing it by updating the Gradle tool's properties.

ACKs for top commit:
  fanquake:
    ACK 5f50406 - seems fine.

Tree-SHA512: 52e59fe1c69841370ce2eb670f3618182bf2843582074af4895b8ecb6e5f70dc3fe4eecbffa212efaa534b423ced5b75020f6f09917b52f452121c1e55fbcaac
Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Oct 13, 2023
78d3062 ci: Install Android API 31 platform as Qt expects (Hennadii Stepanov)

Pull request description:

  When building the `qt` package, it expects that the default (in Qt's view) Android API platform is installed.

  During the recent Qt version [update](bitcoin#28561), it has been changed:
  ```diff
  --- a/mkspecs/features/android/sdk.prf
  +++ b/mkspecs/features/android/sdk.prf
  @@ -1,6 +1,6 @@
   API_VERSION_TO_USE = $$(ANDROID_API_VERSION)
   isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION
  -isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-28
  +isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-31

   ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
   !exists($$ANDROID_JAR_FILE) {
  ```

  This PR fixes the CI for the Android task and addresses bitcoin#28561 (comment).

  Qt [docs](https://doc.qt.io/qt-5/android.html) still claim that Android API Level 21 and up are supported, however, I did not test every possible configuration.

  NOTE: bitcoin#28611 is still valid.

ACKs for top commit:
  maflcko:
    lgtm ACK 78d3062
  jarolrod:
    tACK 78d3062

Tree-SHA512: 781fba6d80aae7e6500854de14af0d30169c258e395b9e482a5430a7b4a2211a6181f8c9ee58543c896b431abf09e3e7c5573b9672ed128658f11f98a2006e7e
@bitcoin bitcoin locked and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants