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

PlatformException (PlatformException(no_carrier_name, No carrier name, #31

Open
Imesh7 opened this issue Apr 6, 2023 · 7 comments
Open

Comments

@Imesh7
Copy link

Imesh7 commented Apr 6, 2023

PlatformException (PlatformException(no_carrier_name, No carrier name, java.lang.SecurityException: getDataNetworkTypeForSubscriber, null))

got above issue

@onghuisheng
Copy link
Contributor

try adding a READ_PHONE_STATE permission in your AndroidManifest.xml

@Imesh7
Copy link
Author

Imesh7 commented Apr 10, 2023

@onghuisheng I have tried with the permission , you have mentioned.
Still got the same error

@aakashBodhi
Copy link

@Imesh7 did you find any solution?

@Imesh7
Copy link
Author

Imesh7 commented Apr 20, 2023

@aakashBodhi Still not,

but I have integrate the previous version of this package to my apps.

@onghuisheng
Copy link
Contributor

I can't repro the issue without any more details

@tolzlz
Copy link

tolzlz commented Jun 20, 2023

@Override public CellIdentity getCellLocation(String callingPackage, String callingFeatureId) { mApp.getSystemService(AppOpsManager.class) .checkPackage(Binder.getCallingUid(), callingPackage); LocationAccessPolicy.LocationPermissionResult locationResult = LocationAccessPolicy.checkLocationPermission(mApp, new LocationAccessPolicy.LocationPermissionQuery.Builder() .setCallingPackage(callingPackage) .setCallingFeatureId(callingFeatureId) .setCallingPid(Binder.getCallingPid()) .setCallingUid(Binder.getCallingUid()) .setMethod("getCellLocation") .setMinSdkVersionForFine(Build.VERSION_CODES.Q) .build()); switch (locationResult) { case DENIED_HARD: throw new SecurityException("Not allowed to access cell location"); case DENIED_SOFT: return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) ? new CellIdentityCdma() : new CellIdentityGsm(); } WorkSource workSource = getWorkSource(Binder.getCallingUid()); final long identity = Binder.clearCallingIdentity(); try { if (DBG_LOC) log("getCellLocation: is active user"); int subId = mSubscriptionController.getDefaultDataSubId(); return (CellIdentity) sendRequest(CMD_GET_CELL_LOCATION, workSource, subId); } finally { Binder.restoreCallingIdentity(identity); } }
When reading the Android source code, tell us that you need to authorize the loction permission
Permission.storage,
Permission.phone,
Permission.location
,I get status Success

@arlakay
Copy link

arlakay commented Oct 27, 2023

same issue with version 2.0.8

error log:
I/flutter ( 8201): │ 💡 Couldn't check carier status = PlatformException(no_carrier_name, No carrier name, java.lang.SecurityException: isMultiSimSupported: uid 10288 does not have android.permission.READ_PHONE_STATE., null)

manifest
`

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.READ_BASIC_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />


<application
    android:label="@string/app_name_sales"
    android:name="${applicationName}"
    android:icon="@mipmap/ic_launcher">
    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:requestLegacyExternalStorage="true"
        android:launchMode="singleTask"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">
        <!-- Specifies an Android theme to apply to this Activity as soon as
             the Android process has started. This theme is visible to the user
             while the Flutter UI initializes. After that, this theme continues
             to determine the Window background behind the Flutter UI. -->
        <meta-data
          android:name="io.flutter.embedding.android.NormalTheme"
          android:resource="@style/NormalTheme"
          />

        <meta-data android:name="flutter_deeplinking_enabled" android:value="true" />

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        
    </activity>


    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />

    <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/app_icon" />
    <!-- <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="high_importance_channel" /> -->
    
</application>
`

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

No branches or pull requests

5 participants