AgoraIO-Extensions / Agora-Flutter-SDK

Flutter plugin of Agora RTC SDK for Android/iOS/macOS/Windows

Home Page:https://pub.dev/packages/agora_rtc_engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FOREGROUND_SERVICE_MEDIA_PROJECTION causing playstore to reject updates.

jerrypaulsam opened this issue · comments

Version of the agora_rtc_engine

6.2.1

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows
  • Web

Steps to reproduce

  1. Build appbundle
  2. Upload to Google Play
  3. Gets rejected

Expected results

We are only using audio call service. How to disable FOREGROUND_SERVICE_MEDIA_PROJECTION from manifest?

Actual results

FOREGROUND_SERVICE_MEDIA_PROJECTION causing playstore to reject updates.

Code sample

We tried adding this

configurations.all {
exclude group:"io.agora.rtc", module:"full-screen-sharing"
}

but still, the apk analyzer shows FOREGROUND_SERVICE_MEDIA_PROJECTION in manifest

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.4, on macOS 14.2.1 23C71 darwin-arm64, locale en-IN)
    • Flutter version 3.19.4 on channel stable at /Users/xyz/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 68bfaea224 (12 days ago), 2024-03-20 15:36:31 -0700
    • Engine revision a5c24f538d
    • Dart version 3.3.2
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/xyz/Library/Android/sdk
    • Platform android-34, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)            
    • iPhone (mobile) • 00008110-0018696A1EF0401E • ios            • iOS 17.3.1 21D61
    • macOS (desktop) • macos                     • darwin-arm64   • macOS 14.2.1 23C71 darwin-arm64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 123.0.6312.87

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Maybe you can check this issue for reference #1575

I have checked it, but still facing the same issue. I don't need the video related features as we are only using audio calls with the app. It's been a few days since we uploaded the update build and not getting accepted. If the problem cannot be resolved, we might even need to remove the audio call feature completely until we find a workaround.

Can you try these steps to confirm where the permission is from?
#1575 (comment)

@littleGnAl I did. We did try all those and still the release manifest is showing the FOREGROUND_SERVICE_MEDIA_PROJECTION. As of now, we are removing the package and planning an alternative in the meantime.

We did try all those and still the release manifest is showing the FOREGROUND_SERVICE_MEDIA_PROJECTION. As of now

Is it from our package?

Yes, as per the log. We don't have any other package which uses the FOREGROUND_SERVICE_MEDIA_PROJECTION

I'm facing same issue and i did exclude "full-screen-sharing" module from project as mentioned here #1458
This way path :android/build.gradle
Screenshot 2024-04-04 at 8 35 15 PM

@melbanna40 Can you follow this step to check if the permission comes from our package?
#1575 (comment)

If you face this issue after these steps #1575 (comment), I think it's better to provide a reproducible demo for further investigation.

@melbanna40 Can you follow this step to check if the permission comes from our package? #1575 (comment)

it was from it.
Application accepted on google play after excluding the "full-screen-sharing" module 🚀
Thanks 🙏

@melbanna40 i added configurations.all {
exclude group:"io.agora.rtc", module:"full-screen-sharing"
}, and the report is not showing the use of FOREGROUND_SERVICE_MEDIA_PROJECTION, but play store is still rejecting the build for not declaring the use of it. can you please explain the step you took get approval from play store

@melbanna40 i added configurations.all { exclude group:"io.agora.rtc", module:"full-screen-sharing" }, and the report is not showing the use of FOREGROUND_SERVICE_MEDIA_PROJECTION, but play store is still rejecting the build for not declaring the use of it. can you please explain the step you took get approval from play store

i just cleared android caches at this paths
cd android
rm -Rf .gradle/caches
m -Rf /app/build
built a new bundle and new release version on google play.

How do you fix this on an expo app ?

I also encountered this issue when uploading my APK to the Play Store. I was able to resolve it by following these steps:

  1. Exclude the full-screen-sharing module in the project-level build.gradle file:

    // build.gradle (project-level)
    
    //...
    
    configurations.configureEach {
        exclude group: "io.agora.rtc", module: "full-screen-sharing"
    }
  2. Remove the FOREGROUND_SERVICE_MEDIA_PROJECTION permission in the AndroidManifest.xml file:

    <!-- AndroidManifest.xml -->
    
    <!-- ... -->
    
    <uses-permission
        android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
        tools:ignore="SystemPermissionTypo"
        tools:node="remove" />
    
    <!-- ... -->