1"use strict";(self.webpackChunkionic_docs=self.webpackChunkionic_docs||[]).push([["32603"],{75014(e,n,o){o.r(n),o.d(n,{metadata:()=>i,default:()=>p,frontMatter:()=>t,contentTitle:()=>c,toc:()=>l,assets:()=>d});var i=JSON.parse('{"id":"troubleshooting/native","title":"Native Errors","description":"Native App Errors: How to Resolve Native Errors on Ionic Apps","source":"@site/versioned_docs/version-v8/troubleshooting/native.mdx","sourceDirName":"troubleshooting","slug":"/troubleshooting/native","permalink":"/docs/v8/troubleshooting/native","draft":false,"unlisted":false,"editUrl":"https://github.com/ionic-team/ionic-docs/edit/main/versioned_docs/version-v8/troubleshooting/native.mdx","tags":[],"version":"v8","frontMatter":{"title":"Native Errors"},"sidebar":"docs","previous":{"title":"Runtime Issues","permalink":"/docs/v8/troubleshooting/runtime"},"next":{"title":"CORS Errors","permalink":"/docs/v8/troubleshooting/cors"}}'),r=o(74848),s=o(28453);let t={title:"Native Errors"},c,d={},l=[{value:"Code Signing errors",id:"code-signing-errors",level:2},{value:"Xcode build error 65",id:"xcode-build-error-65",level:2},{value:"Clashing Google Play Services versions",id:"clashing-google-play-services-versions",level:2}];function a(e){let n={a:"a",code:"code",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components},{Head:i}=n;return i||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Head",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i,{children:[(0,r.jsx)("title",{children:"Native App Errors: How to Resolve Native Errors on Ionic Apps"}),(0,r.jsx)("meta",{name:"description",content:"Review native app errors including code signing, Xcode build error 65, and clashing Google Play Services versions. Learn to resolve native errors on Ionic apps."})]}),"\n",(0,r.jsx)(n.h2,{id:"code-signing-errors",children:"Code Signing errors"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"Code Signing Error: Failed to create provisioning profile. The app ID \"com.csform.ionic.yellow\"
1cannot be registered to your development team. Change your bundle identifier to a unique string to try again. Code Signing Error: No profiles for 'com.csform.ionic.yellow' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.csform.ionic.yellow'. Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'\n"})}),"\n",(0,r.jsx)(n.p,{children:"Running an app on an iOS device requires a provisioning profile. If a provisioning profile has not been created yet follow these directions:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["Set the ",(0,r.jsx)(n.a,{href:"/docs/v8/reference/glossary#package-id",children:"Package ID"}),"."]})}),"\n",(0,r.jsxs)(n.p,{children:["For Capacitor, open the ",(0,r.jsx)(n.code,{children:"capacitor.config.json"})," file and modify the ",(0,r.jsx)(n.code,{children:"appId"})," property."]}),"\n",(0,r.jsxs)(n.p,{children:["For Cordova, open the ",(0,r.jsx)(n.code,{children:"config.xml"})," file and modify the ",(0,r.jsx)(n.code,{children:"id"})," attribute of the root element, ",(0,r.jsx)(n.code,{children:"<widget>"}),". Refer to ",(0,r.jsx)(n.a,{href:"https://cordova.apache.org/docs/en/latest/config_ref/#widget",children:"the Cordova documentation"})," for more information."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["Open the project in ",(0,r.jsx)(n.strong,{children:"Xcode"}),"."]})}),"\n",(0,r.jsx)(n.p,{children:"For Capacitor, run the following to open the app in Xcode:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"$ ionic capacitor open ios\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For Cordova, open Xcode. Use ",(0,r.jsx)(n.strong,{children:"File"})," \xbb ",(0,r.jsx)(n.strong,{children:"Open"})," and locate the app. Open the app's ",(0,r.jsx)(n.code,{children:"platforms/ios"})," directory."]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:(0,r.jsxs)(n.strong,{children:["In ",(0,r.jsx)(n.strong,{children:"Project navigator"}),", select the project root to open the project editor. Under the ",(0,r.jsx)(n.strong,{children:"Identity"})," section, verify that the Package ID that was set matches the Bundle Identifier."]})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Xcode showing the Identity section for an iOS app with fields for Display Name, Bundle Identifier, Version, and Build.",src:o(20648).A+"",title:"Xcode Identity Section",width:"2916",height:"1810"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsxs)(n.strong,{children:["In the same project editor, under the ",(0,r.jsx)(n.strong,{children:"Signing"})," section, ensure ",(0,r.jsx)(n.strong,{children:"Automatically manage signing"})," is enabled."]})," Then, select a Development Team. Given a Development Team, Xcode will attempt to automatically prepare provisioning and signing."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Xcode showing the Signing section with 'Automatically manage signing' enabled and a Development Team selected.",src:o(13205).A+"",title:"Xcode Signing Section",width:"2916",height:"1810"})}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"xcode-build-error-65",children:"Xcode build error 65"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/ionitron/projects/my-project/platforms/ios/cordova/build-debug.xcconfig,-workspace,SC project.xcworkspace,-scheme,SC project,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/ionitron/projects/my-project/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/ionitron/projects/my-project/platforms/ios/build/sharedpch\n"})}),"\n",(0,r.jsxs)(n.p,{children:["This error is an error code from Xcode that can be caused by provisioning issues or outdated cordova dependencies. To fix this error first make sure a provisioning profile has been generated using the above instructions and then try to ",(0,r.jsx)(n.a,{href:"/docs/v8/developing/ios",children:"run the app from Xcode"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"If this does not fix the error then run the following commands:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"rm -rf node_modules\nrm -rf platform\nnpm i\nionic cordova platform add ios\nionic cordova prepare ios\nionic cordova build ios --prod\n"})}),"\n",(0,r.jsx)(n.p,{children:"Once these commands have been ran a fresh build can be done."}),"\n",(0,r.jsx)(n.h2,{id:"clashing-google-play-services-versions",children:"Clashing Google Play Services versions"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"Error: more than one library with package name com.google.android.gms\n"})}),"\n",(0,r.jsxs)(n.p,{children:["This error is caused by two separate plugins trying to use different versions of the ",(0,r.jsx)(n.code,{children:"Google Play Services"}),". To fix this issue make sure you are running ",(0,r.jsx)(n.code,{children:"cordova"})," version ",(0,r.jsx)(n.code,{children:"7.1.0"})," or higher and ",(0,r.jsx)(n.code,{children:"cordova-android"})," ",(0,r.jsx)(n.code,{children:"6.3.0"}
1)," or higher. To install latest ",(0,r.jsx)(n.code,{children:"cordova"})," run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"npm install cordova@latest\n"})}),"\n",(0,r.jsxs)(n.p,{children:["and to update ",(0,r.jsx)(n.code,{children:"cordova-android"})," run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"cordova platform update android\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Plugins that depend on ",(0,r.jsx)(n.code,{children:"Google Play Services"})," can now be updated to use the same version. For example, if ",(0,r.jsx)(n.code,{children:"pluginA"})," uses version 11.0 and ",(0,r.jsx)(n.code,{children:"pluginB"})," uses version 15.0 they can be updated to use the same version with the following snippet in the ",(0,r.jsx)(n.code,{children:"config.xml"})," file:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-xml",children:'<plugin name="pluginA" spec="npm">\n <variable name="PLAY_SERVICES_VERSION" value="15.0.0"/>\n</plugin>\n<plugin name="pluginB" spec="npm">\n <variable name="PLAY_SERVICES_VERSION" value="15.0.0" />\n</plugin>\n'})})]})}function p(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},20648(e,n,o){o.d(n,{A:()=>i});let i=o.p+"assets/images/ios-xcode-identity-setup-810a91fa449112c7a3bc48e62d2ceb9b.png"},13205(e,n,o){o.d(n,{A:()=>i});let i=o.p+"assets/images/ios-xcode-signing-setup-9a189ccd440dedd98b3d54a19eb5e68c.png"},28453(e,n,o){o.d(n,{R:()=>t,x:()=>c});var i=o(96540);let r={},s=i.createContext(r);function t(e){let n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.