{"record":{"id":"8688f77b4cb730bc","repo":"MuntashirAkon/AppManager","slug":"package-name-not-found","errorCode":null,"errorMessage":"Package name not found.","messagePattern":"Package name not found\\.","errorType":"exception","errorClass":"ApkFile.ApkFileException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java","lineNumber":356,"sourceCode":"                        mIdsigFile = mFileCache.getCachedFile(mZipFile.getInputStream(zipEntry), \".idsig\");\n                    } catch (IOException e) {\n                        throw new ApkFileException(e);\n                    }\n                }\n            }\n            if (mBaseEntry == null) throw new ApkFileException(\"No base apk found.\");\n            // Sort the entries based on type and rank\n            Collections.sort(mEntries, (o1, o2) -> {\n                Integer int1 = o1.type;\n                int int2 = o2.type;\n                int typeCmp;\n                if ((typeCmp = int1.compareTo(int2)) != 0) return typeCmp;\n                int1 = o1.rank;\n                int2 = o2.rank;\n                return int1.compareTo(int2);\n            });\n        }\n        if (packageName == null) throw new ApkFileException(\"Package name not found.\");\n        mPackageName = packageName;\n    }\n\n    private ApkFile(@NonNull ApplicationInfo info, int sparseArrayKey) throws ApkFileException {\n        mSparseArrayKey = sparseArrayKey;\n        mPackageName = info.packageName;\n        mCacheFilePath = new File(info.publicSourceDir);\n        File sourceDir = mCacheFilePath.getParentFile();\n        if (sourceDir == null || \"/data/app\".equals(sourceDir.getAbsolutePath())) {\n            // Old file structure (storing APK files at /data/app)\n            mEntries.add(mBaseEntry = new Entry(mCacheFilePath, getManifestFromApk(mCacheFilePath), null));\n        } else {\n            File[] apks = sourceDir.listFiles((dir, name) -> name.endsWith(\".apk\"));\n            if (apks == null) {\n                // Directory might be inaccessible\n                Log.w(TAG, \"No apk files found in %s. Using default.\", sourceDir);\n                List<File> allApks = new ArrayList<>();\n                allApks.add(mCacheFilePath);","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java#L338-L374","documentation":"The bundle's base APK entry was found, but the package name could not be read from it (missing or unparseable manifest/metadata in the split), so ApkFile cannot identify what it is opening and aborts. Faulty input: a split archive whose base APK lacks a resolvable package name.","triggerScenarios":"Thrown at app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkFile.java:356 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an intact base APK whose AndroidManifest can be parsed; rebuild the bundle if it was modified","Verify the archive was not edited or re-zipped in a way that dropped manifest entries","Reject the file at import time with a clear user-facing message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}