{"record":{"id":"edcc9090cced57bc","repo":"expo/expo","slug":"cannot-get-guid-with-null-application-application","errorCode":null,"errorMessage":"Cannot get GUID with null `Application.applicationId`","messagePattern":"Cannot get GUID with null `Application\\.applicationId`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/native-component-list/src/api/guid.ts","lineNumber":46,"sourceCode":"  if (['storeClient', 'standalone'].includes(Constants.executionEnvironment)) {\n    if (!GUID)\n      throw new Error(\n        `No valid GUID for Expo Go on platform: ${\n          Platform.OS\n        }. Supported native platforms are currently: ${Object.keys(managedMap).join(', ')}`\n      );\n    return GUID;\n  } else if (Constants.executionEnvironment === 'bare') {\n    if (!BARE_GUIDs) {\n      throw new Error(\n        `No valid GUID for bare projects on platform: ${\n          Platform.OS\n        }. Supported native platforms are currently: ${Object.keys(bareMap).join(', ')}`\n      );\n    }\n\n    if (!Application.applicationId) {\n      throw new Error('Cannot get GUID with null `Application.applicationId`');\n    }\n    if (!(Application.applicationId in BARE_GUIDs)) {\n      throw new Error(\n        `No valid GUID for native app Id: ${Application.applicationId}. Valid GUIDs exist for ${\n          Platform.OS\n        } projects with native Id: ${Object.keys(BARE_GUIDs).join(', ')}`\n      );\n    }\n    return BARE_GUIDs[Application.applicationId];\n  } else {\n    throw new Error(\n      `No GUID available for executionEnvironment: ${Constants.executionEnvironment}`\n    );\n  }\n}\n","sourceCodeStart":28,"sourceCodeEnd":62,"githubUrl":"https://github.com/expo/expo/blob/b09195aac27c9e4a63daaf12dcb6f00b6b2e08ee/apps/native-component-list/src/api/guid.ts#L28-L62","documentation":"Thrown by `getGUID()` in a bare build when `expo-application`'s `Application.applicationId` is null/undefined. The bare GUID lookup is keyed by native application ID, so without it the function cannot determine which GUID to return. This typically means `expo-application` could not read the native bundle's identifier.","triggerScenarios":"Calling `getGUID()` with `executionEnvironment === 'bare'`, a valid `BARE_GUIDs` map, but `Application.applicationId` evaluating falsy (null or undefined).","commonSituations":"expo-application is misconfigured or not linked; the native build did not embed the application identifier (misbuilt iOS bundle / Android package); running in a JS-only test environment where expo-application returns null.","solutions":["Ensure `expo-application` is correctly installed and linked in the bare native project.","Verify the native app has a valid `applicationId` (Android `build.gradle`) / `CFBundleIdentifier` (iOS Info.plist).","In test/Node environments, mock `Application.applicationId` to a known value."],"exampleFix":"// before\nconst guid = getGUID(); // applicationId is null\n\n// after — ensure native id is set, and guard\nguard: if (!Application.applicationId) { throw new Error('link expo-application'); }\nconst guid = getGUID();","handlingStrategy":"validation","validationCode":"import * as Application from 'expo-application';\nfunction hasApplicationId(): boolean {\n  return !!Application.applicationId;\n}","typeGuard":"function hasValidApplicationId(app: typeof Application): boolean {\n  return typeof app.applicationId === 'string' && app.applicationId.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Verify expo-application is installed and linked in bare projects.","Confirm native applicationId/bundleIdentifier is set in Gradle/Info.plist.","Mock Application.applicationId in test environments."],"tags":["expo","guid","expo-application","bare-workflow","native-component-list","config"],"backgroundTag":null,"analyzedSha":"b09195aac27c9e4a63daaf12dcb6f00b6b2e08ee","analyzedAt":"2026-08-12T15:59:58.304Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}