Appium keep on asking "Failed to create session. You must include a platformName capability" - appium

I just try to start session the appium inspector yet it doesn't work as always. I have done all the stuff needed for running those app but still not working.
here's the sign:
"Failed to create session. You must include a platformName capability"
and here is my JSON representation:
"{
  "appium:appPackage": "com.emi.customer.app",
  "appium:appActivity": "com.emi.customer.app.MainActivity",
  "platformName": "Android",
  "appium:deviceName": "Redmi Note 10S",
  "appium:udid": "GEW46XJ7O7V4YTFU"
}"

You try with the desired caps once.
{
"deviceName": "<YOUR_DEVICE_NAME>",
"platformVersion": "<ANDROID_OS_VERSION>",
"platformName": "Android",
"appPackage": "<APP_PACKAGE>",
"appActivity": "APP_ACTIVITY",
"automationName": "UiAutomator2",}

Related

ios App is not showing infoPlist permission string in app store review and got rejected

I am using expo-image-picker in one of my expo managed project (SDK 40). Here is my app.json:
{
"expo": {
"name": "Alpha Soko Classifieds",
"slug": "alphasokoclassifieds",
"version": "1.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"backgroundColor": "#ff4500",
"resizeMode": "contain"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.alpha.soko",
"buildNumber": "2",
"infoPlist": {
"NSCameraUsageDescription": "This app uses the camera to capture and upload user profile image and listing image.",
"NSPhotoLibraryUsageDescription": "This app needs access to the photo library to select and upload user profile image and listing image.",
"NSLocationWhenInUseUsageDescription": "This app usages device location on listing information, Listing search Data and User information."
},
"config": {
"googleMapsApiKey": "AIzaSyCCCF3jLaTY******hGASwzod1bPYNi***"
}
},
"web": {
"favicon": "./assets/favicon.png"
},
"android": {
"package": "com.alpha.soko",
"config": {
"googleMaps": {
"apiKey": "AIzaSyCCCF3jLaTY******hGASwzod1bPYNi***"
}
},
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#fff"
},
"permissions": [
"CAMERA",
"CAMERA_ROLL",
"MEDIA_LIBRARY",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE",
"RECORD_AUDIO",
"READ_PHONE_STATE",
"READ_CONTACTS",
"LOCATION"
],
"versionCode": 2
}
}
}
The standalone build (.ipa) got rejected twice , because it is not showing the text in the permission modal. See the Image apple review team has sent me.
Apple's recommendation is following:
"Please revise the purpose string in your app’s Info.plist file for the photos to explain why your app needs access.
You can modify your app's Info.plist file using the property list editor in Xcode."
I tried with a simulator build and it works well.
I am really confused now . Can Anybody help me with this? What can I do now? Please help.
I had the exact same situation during the same days that you posted this question. Had my app update rejected twice for the same reason, even though I had the proper texts in the Info.plist.
I actually just decided to open an appeal in the conflict resolution center, responding to the rejection by explaining what had happened. I told them there is probably going something wrong in their testing environment, since I'm not the only one who has this problem (I linked to this question on Stackoverflow, so thank you), and told them I can see the messages when I view the app on my device.
Miraculously, they just accepted my update - the exact same build that was rejected previously!
I've found the problem and solved it.
Expo image picker has feature to reduce image quality and crop before "NSPhotoLibraryAddUsageDescription" this permission. I've add this and the problem is gone. Apple approved my app.
Thanks everyone.

Entitlements in your app bundle signature do not match the ones that are contained in your provisioning profile

I'm getting a weird issue, I've not changed any expo settings in the expo app.json, and suddenly Apple is rejecting the archive with the following reason:
ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements
in your app bundle signature do not match the ones that are contained
in the provisioning profile. According to the provisioning profile,
the bundle contains a key value that is not allowed: '[]' for the key
'com.apple.security.application-groups' in
'Payload/ExpoKitApp.app/com.company.appname'.
My expo config is as shown below:
{
"expo": {
"name": "App Name",
"slug": "app-name-slug",
"version": "1.1.1",
"orientation": "portrait",
"icon": "./src/assets/icon.png",
"splash": {
"image": "./src/assets/splash.png",
"resizeMode": "cover",
"backgroundColor": "#000000"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": false,
"bundleIdentifier": "com.company.appname",
"buildNumber": "1.1.1",
"infoPlist": {
"NSCameraUsageDescription": "App Name uses your camera to allow you to upload a profile picture.",
"NSPhotoLibraryUsageDescription": "App Name uses your photos to allow you to upload a profile picture."
}
},
"android": {
"package": "com.company.appname",
"versionCode": 13,
"permissions": []
},
"web": {
"favicon": "./src/assets/favicon.png"
},
"androidStatusBar": {
"barStyle": "light-content",
"backgroundColor": "#042f3d"
},
"androidNavigationBar": {
"barStyle": "dark-content",
"backgroundColor": "#042f3d"
},
"description": ""
}
}
Admittedly this is the first issue I've had with the Apple Review system (this is the first app) so I have no idea where to look. Any help would be appreciated.
Edit: I use expo on windows, and I have App Store Connect.
I am open to correction on this answer of course, but as mentioned in a comment above:
Guess at root cause: (Apple App Store is a closed system, we may only guess)
I believe the Apple back-end has changed as of today, and has started applying a stricter rule to entitlement keys that take array values.
I believe the Apple back-end used to accept empty arrays for entitlement keys that took array values but now requires the entitlement key to either not be present at all, or to contain actual values.
Evidence to back this assertion:
I have an entitlements file with a key for "in-app-messaging" entitlement with an empty array like so:
<key>com.apple.developer.in-app-payments</key>
<array/>
This was fine until just yesterday (I successfully submitted a build, and have submitted builds like this for more than a year.
Now it is no longer fine, and you have a similar empty array message in your error.
The fix:
Open the .xcworkspace (Xcode project) file and navigate to the signing and entitlements for my project, and remove the offending entitlement key
The key was empty anyway so should not have an effect other than now the entitlements file has exactly the lines I quoted above removed
The App Store submission is successful.
To fix this issue (even if you are using the Expo managed workflow and don't have access to the .entitlements file) go into your Apple Developer portal's "Identifiers" tab, open up the relevant app ID, and make sure that you don't have any items checked but not configured.
For example, in this case it looks like you have the app groups item checked, but no app groups actually configured, so it looks like this:

IONIC ios emulator not able to make http requests

having an issue making a post request for ionic 5 on a ios emulator
if I do a request on an android emulator it works fine, but when I do on a IOS emulator I get this error msg
[console.log]: "POST call in error" {
"headers": {
"normalizedNames": {},
"lazyUpdate": null,
"headers": {}
},
"status": 0,
"statusText": "Unknown Error",
"url": " <my url>.json",
"ok": false,
"name": "HttpErrorResponse",
"message": "Http failure response for <my url>/access_token.json: 0 Unknown Error",
"error": {
"isTrusted": true
}
}
this is how I'm making my request, using http-client in angular
import { HttpClient, HttpParams, HttpHeaders } from '#angular/common/http';
Any help is appreciated!
Looks like there is an issue with either the server or the ATS configuration for your iOS project. To verify this, you could try to switch on "Allow Arbitrary Loads" in the Xcode project's Info.plist file.
Set this value to "YES" and check if it works.
You might not find this key in the "Info.plist" file. In that case, you will have to add this key setting.
so it turns out the endpoints I was trying to hit had an expired SSL, which is a no go on IOS. Manage to fix up the ssl and now my app works on IOS, hopefully this help someone else

There was an error during installation: Extension is invalid - Unknown error

can someone find out what is the error in my extension, I do not know why it is saying invalid extension when i try to upload it temporarily. I have developed the same extension for chrome, it works there fine, also operates on opera but not going to install on fireFox. Can anyone specify the problem. Below is my manifest :
{
"name":"My Work Book",
"description":"Save & Manage Your Jobs with ease",
"version":"1.0",
"manifest_version":2,
"icons":{
"16":"icons/job_icon.png",
"32":"icons/job_icon.png",
"64":"icons/job_icon.png"
},
"content_scripts":[{
"matches":[
"<all_urls>"
],
"css": [
"plugins/bootstrap.min.css",
"plugins/fa/css/font-awesome.css",
"style.css"
],
"js":[
"plugins/jquery.js",
"plugins/drag.js",
"content.js",
"general.js"
]
}],
"web_accessible_resources": [
"Icons/*.png",
"Icons/*.svg",
"plugins/fa/css/*.css",
"plugins/fa/fonts/fontawesome-webfont.eot?v=4.7.0",
"plugins/fa/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0",
"plugins/fa/fonts/fontawesome-webfont.woff2?v=4.7.0",
"plugins/fa/fonts/fontawesome-webfont.woff?v=4.7.0",
"plugins/fa/fonts/fontawesome-webfont.ttf?v=4.7.0",
"plugins/fa/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular"
],
"background":[{
"matches":[
"<all_urls>"
],
"scripts":[
"plugins/jquery.js",
"background.js"
]
}],
"permissions":[
"<all_urls>"
],
"browser_action":{
"default_icon":"icons/job_icon.png"
}
}
I did not use any chrome APIs in the content scripts yet, i just used one which is chrome.extension.getURL() which i have changed to browser.extension.getURL() but still getting that error.
It looks like your background entry is invalid. Background scripts run in the background globally so I don't think defining matching URLs is doing anything for you. BTW Firefox will accept either chrome or browser commands.
Try
"background":{
"scripts":["plugins/jquery.js","background.js"]
},

Ionic Push Notification not even sent to iOS (let alone received) on production

I have an issue with Push Notification for iOS in production mode.
I first developed Push for development:
created dev provisioning profile on Mac
created dev certificate on Mac
created a dev security profile in Ionic Dashboard
added dev certificate to dev security profile Ionic dashboard
All worked fine for Android as well as iOS.
 
I then switched to production:
created provisioning profile and certificate for live on Mac
created a live security profile in Ionic Dashboard and added live certificate
 
I always test Push using Postman:
send POST to https://api.ionic.io/push/notifications with body:
{
"tokens": [
"<ios token>",
"<android token>"
],
"profile": "live",
"notification": {
"message": "test",
"ios": {
"priority": 10
},
"android": {
"priority": "high"
}
}
}
response:
{
"data": {
"status": "open",
"config": {
"profile": "live",
"notification": {
"android": {
"priority": "high"
},
"ios": {
"priority": 10
},
"message": "test"
},
"tokens": [
"<ios token>",
"<android token>"
]
},
"created": "2017-02-14T15:07:58.988762+00:00",
"app_id": "<app id>",
"uuid": "<uuid>",
"state": "enqueued"
},
"meta": {
"status": 201,
"request_id": "<request id>",
"version": "2.0.0-beta.0"
}
}
 
To see what's going on, I always send a GET afterwards to https://api.ionic.io/push/notifications/‍<uuid>‍/messages (uuidfrom the first response) and get the following response:
{
"data": [
{
"status": "sent",
"created": "2017-02-14T15:07:59.165266+00:00",
"user_id": null,
"token": {
"token": "<android token>",
"valid": true,
"type": "android",
"app_id": "<app id>",
"invalidated": null,
"id": "<id>",
"created": "2017-02-14T14:27:27.585235+00:00"
},
"error": null,
"notification": "<notification uuid>",
"uuid": "<message uuid>"
}
],
"meta": {
"status": 200,
"request_id": "<request id>",
"version": "2.0.0-beta.0"
}
}
I noticed that the data for the corresponding <ios token> is missing in the response.
I'm wondering why there isn't even an error response as listed at Ionic Docs.
If I send both requests using the dev security profile I get data for iOS stating "error" (APNS_BAD_DEVICE_TOKEN) - which is correct.
I already tried re-creating the certificate and stuff, which does not change the result. I also waited a whole day to receive a notification, in case something takes really long. I made double sure I built the app with the correct profiles in Xcode.
I'm using Xcode 8.2 by the way - and definetly made sure to enable "Push Notifications" in capabilities.
What am I missing?
After contacting the Ionic Support they brought up the idea to check for the tokens being valid.
The How-To is documented in their docs:
(GET) https://api.ionic.io/push/tokens/:token_id (where token_id is a md5 hash of the device token)
I added a Pre-request Script in Postman for that like:
var token = "<your-device-token-to-check>";
var hash = CryptoJS.MD5( token ).toString();
postman.setEnvironmentVariable('token_hash', token);
... and added the new environment variale as a Parameter (not in the Request URL) as key: (leave empty); value: ":{{token_hash}}"
I then found out, that all my iOS tokens were invalidated shortly after they were registered. That's how our first tests succeeded and at further development suddenly failed.
I don't know why they are then left out on the response, when checking for notification status against the Ionic API. I suggested the Support to add an error response (as I understand it, there already is one: 'APNS_BAD_DEVICE_TOKEN' as "The specified device token was bad. Verify that you specified a valid token [...]".)
 
Because I cannot explain why, I just re-created new profiles and certificates (again!), and deleted the old ones from the Keychain Access on the Mac. I re-built the app and everything went fine. Weird...

Resources