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

FOREGROUND_SERVICE_MEDIA_PROJECTION causing playstore to reject updates. #1666

Open
1 of 5 tasks
jerrypaulsam opened this issue Apr 1, 2024 · 16 comments
Open
1 of 5 tasks

Comments

@jerrypaulsam
Copy link

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!
@littleGnAl
Copy link
Collaborator

Maybe you can check this issue for reference #1575

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Apr 1, 2024
@jerrypaulsam
Copy link
Author

jerrypaulsam commented Apr 1, 2024

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.

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Apr 1, 2024
@littleGnAl
Copy link
Collaborator

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

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Apr 2, 2024
@jerrypaulsam
Copy link
Author

@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.

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Apr 2, 2024
@littleGnAl
Copy link
Collaborator

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?

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Apr 3, 2024
@jerrypaulsam
Copy link
Author

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

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Apr 3, 2024
@melbanna40
Copy link

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

@littleGnAl
Copy link
Collaborator

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

@littleGnAl
Copy link
Collaborator

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

@melbanna40
Copy link

@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 🙏

@aruntr369
Copy link

@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
Copy link

@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.

@johneyp
Copy link

johneyp commented May 10, 2024

How do you fix this on an expo app ?

@baharudin-yusup
Copy link
Contributor

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" />
    
    <!-- ... -->

@fahadyaqub
Copy link

fahadyaqub commented Aug 27, 2024

Spent a good part of the day on this. Here is how i was able to finally fix it.

Project-level means the app/build.gradle file. The code snippets here and other places confused me because "repositories" property is only in my the root level gradle file. So basically in app/build.gradle;

signingConfigs{
 ....
}

//this goes in here somewhere
configurations.configureEach {
    exclude group: "io.agora.rtc", module: "full-screen-sharing"
}
compileOptions{
 ...
}

After making these changes, do a clean/build, and "sync gradle with project files".

Important:
If you have uploaded an old bundle (which had this issue), published to any of the other testing releases (internal, closed etc), then the same error will keep appearing for production release, unless you change and upgrade (or remove) the bad bundles from all of those releases - even though the bundle in production release is fixed.

In the error details on playstore it actually lists which bundles have the issue associated with them (but its not that obvious).

So every time you clean/build, check the logs in manifest-merger-release-report.txt - which is created on every compilation. (details linked above by @littleGnAl), once you confirm the permission no longer exists in this log file, upload it, and attach this bundle to all the test and prod release channels.

@popeyewrener
Copy link

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

thanks this solution working for removing foreground services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants