Skip to content

Commit

Permalink
fix: remove error when main activity not found in AndroidManifest.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Nov 29, 2023
1 parent ebde072 commit c1080ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/cli-platform-android/src/config/getMainActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface IntentFilter {
* Reads the AndroidManifest.xml file and returns the name of the main activity.
*/

export default function getMainActivity(manifestPath: string): string | null {
export default function getMainActivity(manifestPath: string): string {
try {
const xmlParser = new XMLParser({ignoreAttributes: false});
const manifestContent = fs.readFileSync(manifestPath, {encoding: 'utf8'});
Expand Down Expand Up @@ -90,9 +90,9 @@ export default function getMainActivity(manifestPath: string): string | null {

return mainActivity ? mainActivity['@_android:name'] : null;
} else {
return null;
return '';
}
} catch {
return null;
return '';
}
}
4 changes: 0 additions & 4 deletions packages/cli-platform-android/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ export function projectConfig(
: packageName;
const mainActivity = getMainActivity(manifestPath || '');

if (!mainActivity) {
throw new CLIError(`Main activity not found in ${manifestPath}`);
}

return {
sourceDir,
appName,
Expand Down

0 comments on commit c1080ad

Please sign in to comment.