Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TECHNICAL] Update Android Gradle Plugin version #4507

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

JuancaG05
Copy link
Collaborator

@JuancaG05 JuancaG05 commented Nov 4, 2024

Related Issues

App: #4478

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

#4507 (comment)

@JuancaG05 JuancaG05 requested a review from joragua November 4, 2024 09:08
@JuancaG05 JuancaG05 self-assigned this Nov 4, 2024
@JuancaG05 JuancaG05 force-pushed the technical/gradle_update branch from 74bc008 to c59eda5 Compare November 4, 2024 10:11
@JuancaG05 JuancaG05 linked an issue Nov 4, 2024 that may be closed by this pull request
10 tasks
Copy link
Collaborator

@joragua joragua left a comment

Choose a reason for hiding this comment

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

A tiny comment to check here @JuancaG05! 🚀

changelog/unreleased/4507 Outdated Show resolved Hide resolved
@JuancaG05 JuancaG05 force-pushed the technical/gradle_update branch from deb80dd to c88506b Compare November 4, 2024 10:53
@JuancaG05 JuancaG05 requested a review from joragua November 4, 2024 10:53
Copy link
Collaborator

@joragua joragua left a comment

Choose a reason for hiding this comment

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

LGTM! Ready for QA ✅

Copy link
Member

@DeepDiver1975 DeepDiver1975 left a comment

Choose a reason for hiding this comment

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

👍

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 4, 2024

Some basic checks here, since this is nothing that needs real QA

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 4, 2024

(1) [FIXED]

Using Android Studio Ladybug to generate a signed APK:

Lint is returning errors that don't allow to build:

Lint found fatal errors while assembling a release target.

Fix the issues identified by lint, or create a baseline to see only new errors.
To create a baseline, run `gradlew updateLintBaseline` after adding the following to the module's build.gradle file:

android {
    lint {
        baseline = file("lint-baseline.xml")
    }
}

For more details, see https://developer.android.com/studio/write/lint#snapshot

owncloudApp/src/main/java/com/owncloud/android/workers/DownloadFileWorker.kt:308: Error: Missing PendingIntent mutability flag [UnspecifiedImmutableFlag]
            PendingIntent.FLAG_ONE_SHOT
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~
owncloudApp/src/main/java/com/owncloud/android/workers/DownloadFileWorker.kt:329: Error: Missing PendingIntent mutability flag [UnspecifiedImmutableFlag]
            0
            ~

   Explanation for issues of type "UnspecifiedImmutableFlag":
   Apps targeting Android 12 and higher must specify either FLAG_IMMUTABLE or
   FLAG_MUTABLE when constructing a PendingIntent.

   FLAG_IMMUTABLE is available since target SDK 23, and is almost always the
   best choice. See
   https://developer.android.com/guide/components/intents-filters#CreateImmuta
   blePendingIntents for a list of common exceptions to this rule.

   https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability
   https://goo.gle/UnspecifiedImmutableFlag

2 errors, 0 warnings

the problem seems to be more related with the android and SDK versions than the gradle one.. but v4.4.1 was correctly built with the same method.

Debug builds (play button) work fine

@DeepDiver1975
Copy link
Member

so apk build is not part of ci ... otherwise this would have been detected by ci - or am I missing anything? THX

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 5, 2024

so apk build is not part of ci ... otherwise this would have been detected by ci - or am I missing anything? THX

ci builds apk with testing purposes (debug mode). The error happened with signed apk (release mode). Release mode is just for releases, for that reason that problem was not detected for the testing jobs.

@DeepDiver1975
Copy link
Member

Is the difference signed vs not signed or debug vs release?

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 5, 2024

the difference in that case is signed vs not signed. It's posible to build release unsigned artifacts

@JuancaG05
Copy link
Collaborator Author

(1) should be fixed now @jesmrec

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 6, 2024

(1) is fixed

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 6, 2024

(2)

The branding build system seems to need kind of update. It fails with the following trace:

* What went wrong:
A problem occurred evaluating project ':owncloudApp'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
      Your current JDK is located in /usr/lib/jvm/java-11-openjdk-amd64
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

we'd need someone with access to the machine to update Java version to 17. Otherwise, it will not be posible to build branded artifacts anymore. Who is in charge of this, @DeepDiver1975 ?

@jesmrec
Copy link
Collaborator

jesmrec commented Nov 6, 2024

(2) will be fixed in the time till next release is done. Without a fix, the branding system will not work anymore. But, the app will go on with the new build setup.

Let's move

@JuancaG05 JuancaG05 merged commit 6ede4f3 into master Nov 6, 2024
7 checks passed
@JuancaG05 JuancaG05 deleted the technical/gradle_update branch November 6, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TECHNICAL] Update Android Gradle Plugin version
4 participants