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:

     0$ make -C src/qt apk
     1...
     2> Task :compileDebugJavaWithJavac FAILED
     3/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:690: error: cannot find symbol
     4                Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
     5                                                                              ^
     6  symbol:   variable R
     7  location: class VERSION_CODES
     8/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:692: error: cannot find symbol
     9                        : m_activity.getDisplay();
    10                                    ^
    11  symbol:   method getDisplay()
    12  location: variable m_activity of type Activity
    13/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:833: error: cannot find symbol
    14        float refreshRate = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
    15                                                                        ^
    16  symbol:   variable R
    17  location: class VERSION_CODES
    18/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtActivityDelegate.java:835: error: cannot find symbol
    19                : m_activity.getDisplay().getRefreshRate();
    20                            ^
    21  symbol:   method getDisplay()
    22  location: variable m_activity of type Activity
    23/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtLayout.java:95: error: cannot find symbol
    24        Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
    25                                                                      ^
    26  symbol:   variable R
    27  location: class VERSION_CODES
    28/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/QtLayout.java:97: error: cannot find symbol
    29                : ((Activity)getContext()).getDisplay();
    30                                          ^
    31  symbol:   method getDisplay()
    32  location: class Activity
    33/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/ExtractStyle.java:418: error: cannot find symbol
    34            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
    35                                                           ^
    36  symbol:   variable Q
    37  location: class VERSION_CODES
    38/home/hebasto/git/gui/src/qt/android/src/org/qtproject/qt5/android/ExtractStyle.java:421: error: cannot find symbol
    39                numStates = stateList.getStateCount();
    40                                     ^
    41  symbol:   method getStateCount()
    42  location: variable stateList of type StateListDrawable
    43Note: Some input files use or override a deprecated API.
    44Note: Recompile with -Xlint:deprecation for details.
    458 errors
    46
    47FAILURE: Build failed with an exception.
    48
    49* What went wrong:
    50Execution failed for task ':compileDebugJavaWithJavac'.
    51> Compilation failed; see the compiler error output for details.
    52
    53* Try:
    54Run 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.
    55
    56* Get more help at https://help.gradle.org
    57
    58Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
    59Use '--warning-mode all' to show the individual deprecation warnings.
    60See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings
    61
    62BUILD FAILED in 827ms
    63...
    

    Fixing it by updating the Gradle tool’s properties.

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

    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.

  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

    0env -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):

    0git 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):

    0git 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:

    0--- a/ci/test/01_base_install.sh
    1+++ b/ci/test/01_base_install.sh
    2@@ -98,7 +98,7 @@ if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then
    3   fi
    4   mkdir -p "$ANDROID_HOME"
    5   unzip -o "$ANDROID_TOOLS_PATH" -d "$ANDROID_HOME"
    6-  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}"
    7+  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}"
    8 fi
    9 
    

    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: 2024-12-03 15:12 UTC

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