Skip to content

[Bug]: Capacitor 9 alpha builds do not support Android 17's new ACCESS_LOCAL_NETWORK permission #8613

Description

@moose4lord

myApp_sdk36.zip

myApp_sdk37.zip

Capacitor Version

Latest Dependencies:

@capacitor/cli: 8.5.2
@capacitor/core: 8.5.2
@capacitor/android: 8.5.2
@capacitor/ios: 8.5.2

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/cli: 9.0.0-alpha.7
@capacitor/core: 9.0.0-alpha.7
@capacitor/android: 9.0.0-alpha.7

Other API Details

npm version: 11.19.0
node version: v24.20.0
Angular version: 22.1.8
Ionic version: @ionic/angular 9.0.4

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

Android 17 (SDK37) introduces a new network permission for accessing devices on the local network, "android.permission.ACCESS_LOCAL_NETWORK". Previously permission to access local network devices used to be granted automatically with "android.permission.INTERNET", but starting in SDK 37 the permission must be granted deliberately. See https://developer.android.com/privacy-and-security/local-network-permission.

Using Capacitor 9 alpha, setting targetSDK=37 and adding the new ACCESS_LOCAL_NETWORK permission to the app AndroidManifest.xml file causes network connections to LAN devices to silently fail.

Expected Behavior

Apparently with SDK 37 you need to add the permission to the manifest file AND add some code to check if the permission has been granted, and if not, pop up a dialog to explicitly ask the user for permission to access the local network.

Project Reproduction

See two attached files. They are Ionic apps which try to make a connection to HTTP servers. myApp_sdk36 uses Capacitor 8 and SDK 36, and seems to work fine, while myApp_sdk37 uses Capacitor 9 alpha and SDK 37 and refuses to make a network connection to devices on the local area network (Internet connections work fine).

Additional Information

I know work on Capacitor 9 is in its early stages, so it's not a big deal yet. I'm just wondering if this is on anyones radar.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions