Adjust Gradle properties to fix `apk` build #28611

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:231008-android changing 1 files +2 −2
  1. hebasto commented at 11:26 AM on October 8, 2023: member

    On the master branch @ d2b8c5e1234cdaff84bd1f60aea598d219cdac5e, 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.

  2. DrahtBot commented at 11:26 AM on October 8, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

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

    <!--021abf342d371248e50ceaed478a90ca-->

    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.

  3. hebasto commented at 11:27 AM on October 8, 2023: member

    Friendly ping @icota @johnny9 :)

  4. hebasto added the label Build system on Oct 8, 2023
  5. hebasto added the label Android on Oct 8, 2023
  6. Adjust Gradle properties
    This change fixes the `apk` target build after bumping Qt version from
    5.15.5 to 5.15.10.
    5f50406554
  7. hebasto force-pushed on Oct 8, 2023
  8. hebasto renamed this:
    Set minimum supported `ANDROID_API_LEVEL` to 31
    Adjust Gradle properties
    on Oct 8, 2023
  9. hebasto renamed this:
    Adjust Gradle properties
    Adjust Gradle properties to fix `apk` build
    on Oct 8, 2023
  10. hebasto commented at 1:09 PM on October 8, 2023: member

    Reworked. The PR description has been updated.

  11. maflcko added this to the milestone 26.0 on Oct 8, 2023
  12. fanquake approved
  13. fanquake commented at 10:44 AM on October 9, 2023: member

    ACK 5f504065544133a47da5a7a240675c23eceb0799 - seems fine.

  14. fanquake merged this on Oct 9, 2023
  15. fanquake closed this on Oct 9, 2023

  16. hebasto deleted the branch on Oct 9, 2023
  17. maflcko commented at 3:13 PM on October 9, 2023: member

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

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

  18. hebasto commented at 3:17 PM on October 9, 2023: member

    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?

  19. maflcko commented at 3:20 PM on October 9, 2023: member

    Yes.

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

  20. hebasto commented at 6:16 PM on October 9, 2023: member

    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 66f8ee2969dcfd5df13f5e33afa80cbc6ffef774, but fails for f4674444b21184ee267675eba4886009b4ec619c.

  21. maflcko commented at 8:06 AM on October 10, 2023: member

    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
    
  22. maflcko commented at 8:08 AM on October 10, 2023: member

    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
    
  23. hebasto commented at 10:22 AM on October 10, 2023: member

    @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)

  24. maflcko commented at 10:46 AM on October 10, 2023: member

    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.

  25. fanquake referenced this in commit ccf7895e17 on Oct 12, 2023
  26. Frank-GER referenced this in commit 9d7fd6e9ca on Oct 13, 2023
  27. Frank-GER referenced this in commit 566839dec4 on Oct 13, 2023
  28. bitcoin locked this on Oct 9, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me