voxeet / voxeet-uxkit-cordova

Dolby.io UXKit for Cordova
Other
1 stars 14 forks source link

[Bug][Android] not able to build for targetSdkVersion = 32 (Android 12) #74

Closed gabides closed 1 year ago

gabides commented 1 year ago

Describe the bug

Not able to build an app targeting adnroid 12 (skd 32) with this plugin. Can you update the android uxkit to a version compatible with android 12?

Expected Behaviour We should be able to target android 32 / gradle v7

[Describe the expected behaviour of the feature.]

Steps to Reproduce the Problem

  1. install latest version of the plugin with npm, set android targetSdkVersion = 32
  2. Try to build on android -> you get this issue:
    What went wrong:
    A problem occurred evaluating script.
    > Could not find method compile() for arguments [com.android.support:multidex:1.0.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

-> I think compile needs to be change to implementation to support latest android build tools

  1. after changing all 3 occurrences of compile to implementation in node_modules/cordova-plugin-voxeet/src/android/build-extras.gradle, build andr oid app -> you get this issue:
    android/app/src/main/AndroidManifest.xml:18:9-22:19 Error:
    android:exported needs to be explicitly specified for element <service#com.voxeet.uxkit.firebase.implementation.VoxeetFirebaseMessagingService>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

-> this is a new hard spec of android to be able to target android 12 (targetSdkVersion = 32)

it is quite urgent to fix this as apps will not be allowed to be pushed to google play starting Nov 1, 2022 if they don't target sdk 32

Specifications

codlab commented 1 year ago

There's a WIP branch for this as well as some improvements, it will be update soon but can be early tested via cordova plugin add "git+https://github.com/voxeet/voxeet-uxkit-cordova#cd234b21ec4848bdfa131dd0da1168029ded7285"

gabides commented 1 year ago

Hey @codlab good news! do you plan to do the same for the capacitor push plugin? https://github.com/voxeet/voxeet-uxkit-capacitor-push/issues/1

codlab commented 1 year ago

It's planned in the upcoming days

gabides commented 1 year ago

When testing the plugin on this commit git+https://github.com/voxeet/voxeet-uxkit-cordova#cd234b21ec4848bdfa131dd0da1168029ded7285, I don't have the issue from the original description but i have this one during the android build:

Could not GET 'https://android-sdk.voxeet.com/release/androidx/core/core/maven-metadata.xml'. Received status code 403 from server: Forbidden
codlab commented 1 year ago

This is another issue which can be mitigated using the commit 4f849af1d6d722ea7126e82402e8f77ad9567aea

cordova plugin add "git+https://github.com/voxeet/voxeet-uxkit-cordova#4f849af1d6d722ea7126e82402e8f77ad9567aea"
gabides commented 1 year ago

Hey @codlab , with the commit https://github.com/voxeet/voxeet-uxkit-cordova/commit/4f849af1d6d722ea7126e82402e8f77ad9567aea i get this new error during android build now:

Could not HEAD 'https://android-sdk.voxeet.com/releases/com/voxeet/sdk/sdk/3.7.0/sdk-3.7.0.pom'. Received status code 403 from server: Forbidden
codlab commented 1 year ago

Indeed I made a typo while rewriting the content so that it would force the urls only for the expected packages. 449fdb67d4e04c644f7431ee4fb5e92f282108e9 is using the proper release folder instead of the releases. Those issues should disappear as soon as I finish to work on the ci for this project

gabides commented 1 year ago

Thx Kevin, build is now passing with this commit

gabides commented 1 year ago

Hi @codlab any idea of when this will get merged and released? The November deadline is approaching soon on the store..

rbonora commented 1 year ago

Hi any news on this please? this is critical for us thanks

codlab commented 1 year ago

The version 1.5.7 has been pushed 👍 edit : this fixes the above issues, normally everything should be alright. Feel free to reopen a ticket if something happens