expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
792 stars 82 forks source link

android:foregroundServiceType="" while building with eas #2556

Open FurankuSQ opened 3 weeks ago

FurankuSQ commented 3 weeks ago

Build/Submit details page URL

https://expo.dev/accounts/mullersq/projects/notifee-test/builds/b3cd3d57-0609-4219-9843-d4f9be639e7c

Summary

When I build with EAS, some values for android:foregroundServiceType are deleted (microphone, camera), and I have android:foregroundServiceType="" in manifest instead of android:foregroundServiceType="microphone" while building with Android Studio. Minimal exemple: https://github.com/FurankuSQ/notifee-test-eas

Managed or bare?

Bare

Environment

expo-env-info 1.2.0 environment info: System: OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) Shell: 5.1.16 - /bin/bash Binaries: Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node Yarn: 1.22.21 - /usr/local/bin/yarn npm: 10.8.2 - ~/.nvm/versions/node/v18.17.0/bin/npm SDKs: Android SDK: API Levels: 33, 34 Build Tools: 30.0.2, 33.0.1, 34.0.0 System Images: android-34 | Google APIs Intel x86_64 Atom, android-35 | Google Play Experimental 16k Page Size Intel x86_64 Atom npmPackages: expo: ~51.0.28 => 51.0.32 expo-router: ~3.5.23 => 3.5.23 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.74.5 => 0.74.5 react-native-web: ~0.19.10 => 0.19.12 npmGlobalPackages: eas-cli: 12.3.0 expo-cli: 6.3.10 Expo Workflow: bare

Error output

No response

Reproducible demo or steps to reproduce from a blank project

https://github.com/FurankuSQ/notifee-test-eas eas build --profile development --platform android Manifest: <?xml version="1.0" encoding="utf-8" standalone="no"?>

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<queries>
    <intent>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="https"/>
    </intent>
    <package android:name="host.exp.exponent"/>
    <intent>
        <action android:name="android.intent.action.OPEN_DOCUMENT_TREE"/>
    </intent>
    <intent>
        <action android:name="android.support.customtabs.action.CustomTabsService"/>
    </intent>
</queries>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<permission android:name="com.mullersq.notifeetest.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" android:protectionLevel="signature"/>
<uses-permission android:name="com.mullersq.notifeetest.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:maxSdkVersion="30" android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS"/>
<uses-permission android:minSdkVersion="23" android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>
<application android:allowBackup="true" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:debuggable="true" android:extractNativeLibs="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name="com.mullersq.notifeetest.MainApplication" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
    <meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
    <service android:exported="false" android:foregroundServiceType="" android:name="app.notifee.core.ForegroundService"/>
    <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode" android:exported="true" android:launchMode="singleTask" android:name="com.mullersq.notifeetest.MainActivity" android:screenOrientation="portrait" android:theme="@style/Theme.App.SplashScreen" android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="myapp"/>
            <data android:scheme="com.mullersq.notifeetest"/>
            <data android:scheme="exp+notifee-test"/>
        </intent-filter>
    </activity>
    <activity android:exported="false" android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
    <provider android:authorities="com.mullersq.notifeetest.notifee-init-provider" android:exported="false" android:initOrder="-100" android:name="io.invertase.notifee.NotifeeInitProvider"/>
    <activity android:exported="true" android:launchMode="singleTask" android:name="expo.modules.devlauncher.launcher.DevLauncherActivity" android:theme="@style/Theme.DevLauncher.LauncherActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="expo-dev-launcher"/>
        </intent-filter>
    </activity>
    <activity android:name="expo.modules.devlauncher.launcher.errors.DevLauncherErrorActivity" android:screenOrientation="portrait" android:theme="@style/Theme.DevLauncher.ErrorActivity"/>
    <activity android:exported="true" android:launchMode="singleTask" android:name="expo.modules.devmenu.DevMenuActivity" android:theme="@style/Theme.AppCompat.Transparent.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="expo-dev-menu"/>
        </intent-filter>
    </activity>
    <provider android:authorities="com.mullersq.notifeetest.FileSystemFileProvider" android:exported="false" android:grantUriPermissions="true" android:name="expo.modules.filesystem.FileSystemFileProvider">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_system_provider_paths"/>
    </provider>
    <meta-data android:name="org.unimodules.core.AppLoader#react-native-headless" android:value="expo.modules.adapters.react.apploader.RNHeadlessAppLoader"/>
    <meta-data android:name="com.facebook.soloader.enabled" android:value="true"/>
    <provider android:authorities="com.mullersq.notifeetest.androidx-startup" android:exported="false" android:name="androidx.startup.InitializationProvider">
        <meta-data android:name="androidx.work.WorkManagerInitializer" android:value="androidx.startup"/>
        <meta-data android:name="androidx.emoji2.text.EmojiCompatInitializer" android:value="androidx.startup"/>
        <meta-data android:name="androidx.lifecycle.ProcessLifecycleInitializer" android:value="androidx.startup"/>
    </provider>
    <service android:directBootAware="false" android:enabled="@bool/enable_system_alarm_service_default" android:exported="false" android:name="androidx.work.impl.background.systemalarm.SystemAlarmService"/>
    <service android:directBootAware="false" android:enabled="@bool/enable_system_job_service_default" android:exported="true" android:name="androidx.work.impl.background.systemjob.SystemJobService" android:permission="android.permission.BIND_JOB_SERVICE"/>
    <service android:directBootAware="false" android:enabled="@bool/enable_system_foreground_service_default" android:exported="false" android:name="androidx.work.impl.foreground.SystemForegroundService"/>
    <receiver android:directBootAware="false" android:enabled="true" android:exported="false" android:name="androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver"/>
    <receiver android:directBootAware="false" android:enabled="false" android:exported="false" android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryChargingProxy">
        <intent-filter>
            <action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
            <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
        </intent-filter>
    </receiver>
    <receiver android:directBootAware="false" android:enabled="false" android:exported="false" android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryNotLowProxy">
        <intent-filter>
            <action android:name="android.intent.action.BATTERY_OKAY"/>
            <action android:name="android.intent.action.BATTERY_LOW"/>
        </intent-filter>
    </receiver>
    <receiver android:directBootAware="false" android:enabled="false" android:exported="false" android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$StorageNotLowProxy">
        <intent-filter>
            <action android:name="android.intent.action.DEVICE_STORAGE_LOW"/>
            <action android:name="android.intent.action.DEVICE_STORAGE_OK"/>
        </intent-filter>
    </receiver>
    <receiver android:directBootAware="false" android:enabled="false" android:exported="false" android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$NetworkStateProxy">
        <intent-filter>
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
        </intent-filter>
    </receiver>
    <receiver android:directBootAware="false" android:enabled="false" android:exported="false" android:name="androidx.work.impl.background.systemalarm.RescheduleReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
            <action android:name="android.intent.action.TIME_SET"/>
            <action android:name="android.intent.action.TIMEZONE_CHANGED"/>
        </intent-filter>
    </receiver>
    <receiver android:directBootAware="false" android:enabled="@bool/enable_system_alarm_service_default" android:exported="false" android:name="androidx.work.impl.background.systemalarm.ConstraintProxyUpdateReceiver">
        <intent-filter>
            <action android:name="androidx.work.impl.background.systemalarm.UpdateProxies"/>
        </intent-filter>
    </receiver>
    <receiver android:directBootAware="false" android:enabled="true" android:exported="true" android:name="androidx.work.impl.diagnostics.DiagnosticsReceiver" android:permission="android.permission.DUMP">
        <intent-filter>
            <action android:name="androidx.work.diagnostics.REQUEST_DIAGNOSTICS"/>
        </intent-filter>
    </receiver>
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
    <service android:directBootAware="true" android:exported="false" android:name="androidx.room.MultiInstanceInvalidationService"/>
    <service android:exported="false" android:name="app.notifee.core.ReceiverService"/>
    <activity android:excludeFromRecents="true" android:exported="true" android:name="app.notifee.core.NotificationReceiverActivity" android:noHistory="true" android:taskAffinity="" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
    <receiver android:exported="false" android:name="app.notifee.core.RebootBroadcastReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
            <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
            <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
        </intent-filter>
    </receiver>
    <receiver android:exported="true" android:name="app.notifee.core.AlarmPermissionBroadcastReceiver">
        <intent-filter>
            <action android:name="android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED"/>
        </intent-filter>
    </receiver>
    <receiver android:exported="false" android:name="app.notifee.core.NotificationAlarmReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
            <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
            <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
        </intent-filter>
    </receiver>
    <receiver android:exported="false" android:name="app.notifee.core.BlockStateBroadcastReceiver">
        <intent-filter>
            <action android:name="android.app.action.APP_BLOCK_STATE_CHANGED"/>
            <action android:name="android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED"/>
            <action android:name="android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED"/>
        </intent-filter>
    </receiver>
</application>

szdziedzic commented 1 week ago

some values for android:foregroundServiceType are deleted (microphone, camera)

Hi, I don't see an Android manifest in your example repo. What do you by are deleted? When does it happen? Can you explain your flow in more detail, please?

FurankuSQ commented 1 week ago

I’ve been working with a plugin that adds the permission android:foregroundServiceType="microphone". When I build using EAS (either locally or in the cloud) and examine the APK’s manifest (using APKtool extraction or Android Studio) on Ubuntu, I notice that android:foregroundServiceType="" appears instead. However, when I inspect the same APK’s manifest on an iMac, the android:foregroundServiceType="microphone" value is correctly present.

The strangest part is that if I build the APK using Android Studio, I see android:foregroundServiceType="microphone" even when checking the manifest on Ubuntu. This suggests that it’s a bug related to the display or retrieval of the value, not its actual presence in the APK.