I’m trying to use the Group Extension API in BuddyPress but keep getting a fatal error [closed]

You can get this fatal error if you plugin is loaded before BuddyPress, if you’re creating extension for BuddyPress, first you should check if BuddyPress is active and loaded, here is suggested method from BP Codex.

/*
Plugin Name: My Plugin
Plugin URI: http://example.org/my-plugin/
Description: My BuddyPress plugin
Version: 1.0
Requires at least: WordPress 2.9.1 / BuddyPress 1.2
Tested up to: WordPress 2.9.1 / BuddyPress 1.2
License: GNU/GPL 2
Author: Some Person
Author URI: http://example.org/me/
*/

/* Only load code that needs BuddyPress to run once BP is loaded and initialized. */
function my_plugin_init() {
    require( dirname( __FILE__ ) . '/my-plugin.php' );
}
add_action( 'bp_include', 'my_plugin_init' );

/* If you have code that does not need BuddyPress to run, then add it here. */

Source: Checking For BuddyPress