I am trying to get storage permission in the initstate() function of the class.I used two packages - Simple_Permissions and Permission package. But both give the same error to me.
FYI - I have put the permission in manifest already.
"E/SimplePermission( 6405): set to never ask againandroid.permission.WRITE_EXTERNAL_STORAGE
I/SimplePermission( 6405): Requesting permission status : 4
I/flutter ( 6405): permission request result is PermissionStatus.deniedNeverAsk"
What I understood from this is that this error should come if the permission was set to "never ask again" by the user . But it is the first time I am requesting storage permission in my app .
What I have tried:
Uninstalling and reinstalling the app.
Using 2 different permission packages
Running app on different Android Versions, different emulators.
Also:
I request 2 permissions in my app, one for location and other for writing storage.
When I go to the settings --> installed apps --> permissions --> I CAN see the permission for location and I can turn it on/off. But I CANNOT see permission for storage.
Have you added the below code to android manifest file?
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
Another way to access storage using permission_handler package
dependencies:
permission_handler: ^5.0.1
Code Snippet
status.isUndetermined is used to determine whether we had asked for permission yet or not.
var status = await Permission.storage.status;
if (status.isUndetermined) {
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.storage,
Permission.camera,
].request();
print(statuses[Permission.storage]); // it should print PermissionStatus.granted
}
Note: Don't forget to add permission in AndroidMenifest for android & info.plist for iOS.
This may be happening because another plugin is setting android:maxSdkVersion attribute on your WRITE_EXTERNAL_STORAGE declaration in the AndroidManifest.xml Try replacing the line in AndroidManifest.xml with:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:remove="android:maxSdkVersion"/>
This fixed the issue for me.
Related
Today i built my app for Android and after that i upload it to google play. Everything worked great since i got so many permissions that i dont really need.
Image
They are 13
android.permission.ACCESS_COARSE_LOCATION,
android.permission.ACCESS_FINE_LOCATION,
android.permission.ACCESS_NETWORK_STATE, android.permission.INTERNET,
android.permission.MODIFY_AUDIO_SETTINGS,
android.permission.READ_EXTERNAL_STORAGE,
android.permission.READ_PHONE_STATE,
android.permission.SYSTEM_ALERT_WINDOW, android.permission.VIBRATE,
android.permission.WAKE_LOCK,
android.permission.WRITE_EXTERNAL_STORAGE,
com.google.android.c2dm.permission.RECEIVE,
com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE
I need only for write and read storage for async storage lib
So i read some information about how to remove it. And i tried follwoing steps
First i add in app.js following line
"android": {
"permissions": [
"WRITE_EXTERNAL_STORAGE",
"READ_EXTERNAL_STORAGE",
"READ_INTERNAL_STORAGE"
],
Not worked then
delete expo-location from package-lock.json and node_modules folder and ran npm install - again not worked.
I used eas build with SDK version 41.0.0 and npm version 7.15.1
Thanks for your time !
Official documentation says:
To use ONLY the following minimum necessary permissions and none of
the extras supported by Expo in a default managed app, set permissions
to []. The minimum necessary permissions do not require a Privacy
Policy when uploading to Google Play Store and are: • receive data
from Internet • view network connections • full network access •
change your audio settings • prevent device from sleeping To use ALL
permissions supported by Expo by default, do not specify the
permissions key. To use the minimum necessary permissions ALONG
with certain additional permissions, specify those extras in
permissions, e.g. [ "CAMERA", "ACCESS_FINE_LOCATION" ].
Thats why you have extra permissions, you can read about it here
Strangely but I found the solution. Just ran
npm uninstall react-native-maps
.Maybe this lib cause that problem
I want to remove default android permissions in react-native app:
READ_PHONE_STATE,
WRITE_EXTERNAL_STORAGE
READ_EXTERNAL_STORAGE.
The only way I found to do it, is to modify AndroidManifest.xml :
https://facebook.github.io/react-native/docs/removing-default-permissions.
My question is: there is a way to do it without ejecting my app? As I don't want to loose the features which Expo provides.
Take a loot at the docs.
Where they say:
Note: If you don't specify android.permissions inside your app.json, by default your standalone Android app will require all of the permissions listed above.
Also look at:
In order to request permissions in a standalone Android app, you need to specify the corresponding native permission types in the android.permissions key inside app.json read more about configuration. The mapping between Permissions values and native permission types is as follows
You can add in your app.json only the permissions you want:
{
...
"permissions": [ ... ]
}
According to https://developer.android.com/training/wearables/watch-faces/service.html, I need the two privileges shown here from my manifest file:
<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<!-- So we can keep the screen on and start vibrations -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
However, starting recently (perhaps since I upgraded my watch to 6.0?) I see the following in the log:
06-07 12:14:24.609 470-493/? W/PackageManager: Unknown permission com.google.android.permission.PROVIDE_BACKGROUND in package com.pipperpublishing.refwatch
I've Googled for any changes in the permission model, perhaps associated with the new model in 6.0, but can't find anything about this.
Any thoughts?
UPDATE: Looking at https://developer.android.com/reference/android/Manifest.permission.html it's clear that PROVIDE_BACKGROUND is no longer there, but I can't find anything that says it's been replaced or why it's no longer needed.
I relayed this question over to the Wear development community on G+, and according to a Google dev advocate there, this permission was never actually used - and is safe to remove from your manifests.
Reference: https://plus.google.com/+SterlingUdell/posts/hvec9y93Gtf
Did anyone have any success integrating crashlytics with github, I'm not really sure how relevant this question would be here?
I have android app already on github, and I have crashltyics correctly integrated in the app, but I tried to link it to the github repository and I'm always gettings, couldn't access repository (I contacted them so many time but they never replied) I'm 100% sure I generated the token as described (as I already did this for other apps) but Crashlytics is always rejecting this github token.
did anyone have success integrating it?
The error I'm getting is as follows:
Could not access repository for https://github.com/User/Repository
I followed the steps as per this link:
https://help.github.com/articles/creating-an-access-token-for-command-line-use
I also tried to do this with one of my open-source libs
https://github.com/shehabic/closeby
but it didn't work either, I'm not sure if it's me or crashlytics Github integration is not working
Ok, I finally got a reply from them and found out how to do it:
Simply when entering the repository in the corresponding field enter is as follows:
user/repo
instead of
http://github.com/user/repo
the integration is not really that powerful, it just creates an issue with just 1 line, without any referral to the code repo in github
I was also facing same problem but i fixed it as follows,
Step1 : Your GitHub repository: Company Name>/Repository Name
e.g cmpanyXYZ/abcd
(Note : 1. do not use .git at end of repository name. 2. You can find this details in repository clone url)
Step 2 : Generate access token from here
Copy generated token in step2 box from image.
Now Click on Verify button
Go to Firebase -> Crashlytics.
Follow the documentation step by step.
There is also a script demonstrating how to force crash and test the app.
Make sure you give the correct path of Google Info pList file in
the AppDelegate.
I am trying to configure my app to support push notification, but keep getting this error:
Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x1f818fc0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
I did enable my app to support push notifications (only for development at this point).
I did create the provisioning profile AFTER enabling the push notifications.
My bundle identifier is the same as appears in the profile.
In my profile file there is a string: aps-environment
I made sure that in both project and target under the "Code signing identity" section ALL the values are selected to be my provisioning profile.
Any more ideas? Thanks.
In my case, the stuff in my provisioning profile:
security cms -D -i ~/Downloads/spolskyDevelop.mobileprovision
...
<key>application-identifier</key>
<string>P5GM95Q9VV.com.dca.spolsky</string>
<key>aps-environment</key>
<string>development</string>
Was different than the stuff in the app that was actually built (you can find out where it is built by looking at Xcode's Logs tab)
codesign -d --entitlements - '/Users/drew/Library/Developer/Xcode/DerivedData/spolsky-bdbtdfjeeywhqzccpmmceqvnhgtm/Build/Products/Debug-iphoneos/spolsky-ios.app'
<dict>
<key>application-identifier</key>
<string>Y2X6Z7Z2GR.com.dca.spolsky-ios</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>Y2X6Z7Z2GR.com.dca.spolsky-ios</string>
</array>
</dict>
This was true even though the "Currently Matches" hint text under Code Signing Identity was indicating the correct provisioning profile--weird, huh? To make a weird story weirder, the correct provisioning profile was being installed on the device when I ran, (Settings->General->Profiles) leading me to believe the provisioning profile was right--but it was falling back to a wildcard ID when the app was actually launched.
The clue was the difference in the output of these two commands:
Y2X6Z7Z2GR.com.dca.spolsky-ios vs P5GM95Q9VV.com.dca.spolsky
When I made the bolded part match, the italicized part changed to match automatically. In addition, the output of security and codesign were in agreement, and no more aps-entitlement error.
My guess here is that XCode was using a wildcard-style match on my non-wildcard ID. ("spolsky" is, after all, quite nearly "spolsky-ios"), and this explains the "Currently Matches" output. But something in the build chain is more strict about this, so it falls back to an actual wildcard ID during the build.
The problem is due to current Provisioning Profile does not contain APNS information, as the Provisioning Profile is created BEFORE creating the APNS certificate.
Therefore, to solve the problem, create a new Provisioning Profile & select the Provisioning Profile in Xcode will clear the error.
I had this same problem after push notifications were already working on my device. Seemed like Xcode cached something incorrectly so refreshing it fixed my problem:
Xcode -> Preferences -> Accounts
View Details for your Developer Account
Just click Refresh for the Provision Profiles a few times. I was seeing these change with each refresh. Keep refreshing until they stop changing.
i got this error and did not create a new provisioning profile; created a new one and then had to restart xCode but works now!
Be aware that the bundle identifier must match the provisioning profile in a case-sensitive manner. I had something like com.FirstLast.appname when it should have been com.firstlast.appname. Well, that kept me busy for quite a while.
I fixed this problem by enabling push notification capability.
Select Project > Target > Capabilities > Turn On Push notifications
If this problem happened suddenly after upgrading to Xcode 8 you might find a warning in the capabilities screen that'll allow you to fix this automatically:
Select Project > Target > Capabilities > Turn On Push notifications
Product->Clean did it for me. Hopefully it does it for someone else.
I ran into this in what's possibly a non-frequent use case. I'm working with Xcode 6 and iOS 8. I was creating a series of entirely new app projects, and attempting to re-use the same bundle ID, so as not to need to go through all of the portal-side setup again. This too was just for sandbox testing.
I would find that, while the setup and registration would work fine for the first app, if I deleted that app from the device, set the same bundle ID for the second app, and then attempted to register PNs with that app, I would get this error.
My solution was to:
Remove the associated provisioning profile from the device.
Remove the associated provisioning profile from Xcode.
Close Xcode
Double-click my downloaded .mobileprovision file to install it back into Xcode
Open the project and deploy it.
This approach seems to jar loose whatever previous state was there, and I'm able to register for PNs with the new app / same bundle ID.
For those who got this error in ios 10, you can try following steps:
1.clean your project.
2.and check Targets -> Capabilities -> Push Notification.If it is off,On it.
And problem will solve.The above steps help me to get rid off this problem. Hope it will helpful to someone.
New provisioning profile worked for me. Make sure to use a Developer profile if you are in development (don't use Ad Hoc). It was fine after that, no idea why the old one stopped working right.