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

Target API 32 (Android 12) #6929

Merged
merged 20 commits into from
Sep 22, 2022
Merged

Target API 32 (Android 12) #6929

merged 20 commits into from
Sep 22, 2022

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Aug 24, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Fix #6863

Motivation and context

Support the latest stable version. Unblock some dependency upgrades.

Screenshots / GIFs

Tests

  • Sanity test

image

  • Smoke test

Limitations:

  • Left Drawer in room list: less accessible. User has to long click on the left then swipe to open it. Else clicking on the burger menu at top left.
  • Left Drawer in room timeline: breadcrumbs cannot be accessed easily. This is covered by Remove Breadcrumbs #2996. Anyway those breadcrumbs will be removed from their current place with the work about AppLayout.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty
Copy link
Member Author

bmarty commented Aug 29, 2022

Blocked for task ./gradlew instrumentationTestsWithCoverage :

Here are the logs:

* What went wrong:
Execution failed for task ':element-android:vector:mergeExtDexGplayDebug'.
> Could not resolve all files for configuration ':element-android:vector:gplayDebugRuntimeClasspath'.
   > Failed to transform emoji-google-release.aar (com.vanniktech:emoji-google-android:0.15.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
      > Execution failed for JacocoTransform: /Users/bmarty/.gradle/caches/transforms-3/8342f4aa3442dc9eb1c78fe1c6583e69/transformed/jetified-emoji-google-release-runtime.jar.
         > org.gradle.internal.operations.BuildOperationInvocationException (no error message)
...
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':element-android:vector:mergeExtDexGplayDebug'.
...
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':element-android:vector:gplayDebugRuntimeClasspath'.
...
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform emoji-google-release.aar (com.vanniktech:emoji-google-android:0.15.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
...
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Execution failed for JacocoTransform: /Users/bmarty/.gradle/caches/transforms-3/8342f4aa3442dc9eb1c78fe1c6583e69/transformed/jetified-emoji-google-release-runtime.jar.
...
Caused by: org.gradle.internal.operations.BuildOperationInvocationException
 ...
Caused by: java.io.IOException: Error while instrumenting com/vanniktech/emoji/google/category/SmileysAndPeopleCategoryChunk2.class.
...
Caused by: org.objectweb.asm.MethodTooLargeException: Method too large: com/vanniktech/emoji/google/category/SmileysAndPeopleCategoryChunk2.<clinit> ()V
...

So this class constructor is too big: https://github.com/vanniktech/Emoji/blob/master/emoji-google/src/commonMain/kotlin/com/vanniktech/emoji/google/category/SmileysAndPeopleCategoryChunk2.kt#L22

I will open an issue there, the chunk2 should be probably split into smaller chunks...

dependabot bot and others added 16 commits September 16, 2022 23:00
Bumps appcompat from 1.4.2 to 1.5.0.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps emoji2 from 1.1.0 to 1.2.0.

---
updated-dependencies:
- dependency-name: androidx.emoji2:emoji2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…help to detect other deprecated API usage.
… from being backed up. Also properly support Android 11.
WARNING:API 'ApkVariantOutput.getVersionCodeOverride()' is obsolete and has been replaced with 'VariantOutput.versionCode()'.
@bmarty bmarty marked this pull request as ready for review September 16, 2022 21:30
@bmarty bmarty requested review from a team and ericdecanini and removed request for a team September 16, 2022 21:30
@bmarty
Copy link
Member Author

bmarty commented Sep 16, 2022

Unblocked using a SNAPSHOT version, which is not ideal (non reproductible build), but this is a temporary measure.

@bmarty bmarty changed the title Target API 32 (Android 12) - WIP Target API 32 (Android 12) Sep 19, 2022
@ElementBot
Copy link

ElementBot commented Sep 19, 2022

Warnings
⚠️

library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt#L123 - Custom view FrameLayout has setOnTouchListener called on it but does not override performClick

⚠️

library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt#L123 - Custom view FrameLayout has setOnTouchListener called on it but does not override performClick

⚠️

vector/src/main/AndroidManifest.xml#L203 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L203 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L206 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L206 - Consider splitting data tag into multiple tags with individual attributes to avoid confusion

⚠️

vector/src/main/AndroidManifest.xml#L260 - Expecting android:screenOrientation="unspecified" or "fullSensor" for this activity so the user can use the application in any orientation and provide a great experience on Chrome OS devices

⚠️

vector/src/main/AndroidManifest.xml#L260 - Expecting android:screenOrientation="unspecified" or "fullSensor" for this activity so the user can use the application in any orientation and provide a great experience on Chrome OS devices

⚠️

vector/src/main/AndroidManifest.xml#L269 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L269 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L276 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L276 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L282 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L282 - Attribute supportsPictureInPicture is only used in API level 24 and higher (current min is 21)

⚠️

vector/src/main/AndroidManifest.xml#L400 - Exported receiver does not require permission

⚠️

vector/src/main/AndroidManifest.xml#L400 - Exported receiver does not require permission

Generated by 🚫 dangerJS against b9c28ba

@SuppressLint("WrongConstant")
window.decorView.windowInsetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_BARS_BY_SWIPE
}
window.decorView.windowInsetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Much of this looks similar to the same code in VectorBaseActivity. Is there a way we can reduce the duplication?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, when we will have a core module.

Comment on lines +87 to +88
val a = requireActivity().windowManager.currentWindowMetrics
a.bounds.width()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I don't think the variable serves any value here

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, it's assigned to val screenWidthInPx.

@sonarcloud
Copy link

sonarcloud bot commented Sep 21, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

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.

[Android 12] Set 'compileSdk' and targetSdk to 32
3 participants