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
Related
we found there are many additional permissions(not used by our app) in the ad kit. Any one please let us know if they are able to be removed? Generally users are very sensitive to permissions, especially as they are not required for the app functionalities.
If your app does not require any of the additional permissions, add the code similar to the following in the AndroidManifest.xml file to remove the permission:
<manifest ... xmlns:tools="http://schemas.android.com/tools">
...
<uses-permission android:name="android.permission.INTERNET" tools:node="remove" />
...
</manifest>
For more information please refer this link of SDK Data Security
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/publisher-service-personal-data-0000001050066921#section8547110181017
I am trying to include the method name %method in log messages when using log4net. However, if I look at the log output it only shows a ? where method name should be.
I know in reading the log4net docs that this is only available with System.Diagnostics.StackTrace and this should only be used in development and not release builds.
Trying to make this work in a .NET Core application using the Microsoft.Extensions.Logging.Log4Net.AspNetCore
and the call to .AddLog4Net(); in Startup
Here is the conversionPattern for the RollingFileAppender
<conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: %message%newline %exception" />
I have put together a github repository with bare bone example of what I'm trying to get at. If you run the project you see the log file output does not contain method information.
Repository available at log4net-netcore-example
In reviewing various SO articles, I've not found the solution to this yet. I'm assuming I'm missing a configuration or maybe a nuget package required to make this work.
Appreciate any insights anyone can provide.
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.
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.
I am sorry for posting so many questions, but getting this to work has been incredibly painful, even tho Testflight makes it much easier
Invalid IPA error: The APS environment in your embedded.mobileprovision and your binary don't match
I figure this has got to do with my Apple Push Notifications. I am using my distribution profile across all my settings. My app has been configured to both development and production.
What could the causes of this error be?
As a side note, I have been working on this for the entire day, and I get stuck at one thing after the other, esp involving static libraries and xcode4. Am I really bad at this, or does Apple really make it so hard?
I think it was an xcode bug. Here's how i solved it, and maybe it can be useful for some users in the future. Including my problem solving steps for reference:
i changed the entitlement file to aps-environment = production. No go, still different between the 2 files.
i changed ALL my settings (debug/not) to the distribution profile, just to be sure
I built it again, and checked out the embedded.mob and binary as you suggested
No go again.
I went nuclear - deleted all my profiles, downloaded only the distribution build i needed
here is when it became interesting - i could not build it on debug (expected), but i was having the same problem of "profile not found" even when i was in ad hoc archiving mode. Surely that means that there remains a reference to the developer mode even when i was trying to archive it (given that i have already changed ALL my settings and deleted all my other profiles)
So i digged up project.pbxproj, and found the offending line that was still trying to access my development profile in ad hoc build. I changed it manually, and bingo, things worked as per expected
End of the day, i am surprised why this would happen. It seems like an xcode 4 bug. Normally it is my fault when these things happen, but this seems arcane enough (plus i had so much trouble with xcode 4 for a few other things).
Solved with help from the amazing Testflight team!
http://support.testflightapp.com/discussions/tools/17-invalid-ipa-the-aps-environment-in-your-embeddedmobileprovision-and-your-binary-dont-match
Also, particularly if the target you're archiving was based on another target, double check that your target's "Archive" Scheme is based on the correct Build Configuration of Build Settings.
In Xcode 4.2 next to the run menu, click on -> Edit
Scheme
Click on the 'Archive' button in the left drawer
Look at 'Build Configuration
For Testflight, I replicate my Release Build Configuration, and rename it 'Ad Hoc' for just this purpose, specifying my Ad Hoc provisioning profile and whatever else needs to be in there. If you've gotten this far, I presume you've already done that, but for posterity, I figured I'd mention it.
I ran across this error before as well, so follow these instructions for this to work:
Create a provisioning profile for your app and add the devices to it of the people who should test it.
Build your application using that provisioning profile you just created and export it as an *ipa.
Upload it to TestFlight and select the devices that you want to test the app on.
Many people miss step 2, (so did I) and that's essential for it to work. So give it a try! :)
Replying this question, in case someone bumps onto this while uploading an air mobile app.
Make SURE you check the Entitlements element in your app.xml.
<iPhone>
<InfoAdditions>
<![CDATA[
<key>UIDeviceFamily</key>
<array>
<!-- iPhone and iPod touch devices -->
<string>1</string>
<!-- iPad devices -->
<string>2</string>
</array>
]]>
</InfoAdditions>
<!-- This part below.. -->
<Entitlements>
<![CDATA[
]]>
</Entitlements>
My Entitlements looked like this back when I got the error:
<Entitlements>
<![CDATA[
<key>application-identifier</key>
<string>QFY9MVY9K8.com.somethingHere.anAppName</string>
<key>aps-environment</key>
<string>development</string>
]]>
</Entitlements>
This is how it looks now:
<Entitlements>
<![CDATA[
<key>get-task-allow</key>
<false/>
]]>
</Entitlements>
This error was caused because
I used a DIFFERENT ID in the <key>application-identifier</key> than the one in my provisioning profile.
I used development key instead of production in the <key>aps-environment</key> part.