Re: Writing a new plugin – get 404 not found when accessing screen
The way in which you check to make sure BuddyPress is installed and activated has changed over time. As @djpaul indicates, the proper way is to use a mypluginname_loader.php file and hook into the bp_include event: https://codex.buddypress.org/extending-buddypress/checking-buddypress-is-active/
The BuddyPress Skeleton Component is woefully out of date a this time. So you should use it as a general guide only. To get a clearly understanding of how things are done, I suggest studying a few of the more popular, major custom components that work with the latest version of BP.