Try this one which use CSS – and is working !
Add the snippet to child-theme’s functions.php
function replace_some_admin_menu_icons() {
// dashicons-performance = f311
// dashicons-smiley = f527
// adminmenu is the ul ID
// the second ID is the li
// div is where the icon goes
?>
<style type="text/css">
#adminmenu #toplevel_page_bp-activity div.wp-menu-image:before {
content: '\f311';
}
#adminmenu #menu-posts-reply div.wp-menu-image:before {
content: '\f527';
}
</style>
<?php }
add_action( 'admin_head', 'replace_some_admin_menu_icons' );
Reference: WordPress Dashicons