{"record":{"id":"3e84832906e72d1b","repo":"bevyengine/bevy","slug":"error-adding-plugin-in-group-plugin-was-alr","errorCode":null,"errorMessage":"Error adding plugin {} in group {}: plugin was already added in application","messagePattern":"Error adding plugin (.+?) in group (.+?): plugin was already added in application","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_app/src/plugin_group.rs","lineNumber":576,"sourceCode":"    }\n\n    /// Consumes the [`PluginGroupBuilder`] and [builds](Plugin::build) the contained [`Plugin`]s\n    /// in the order specified.\n    ///\n    /// # Panics\n    ///\n    /// Panics if one of the plugin in the group was already added to the application.\n    #[track_caller]\n    pub fn finish(mut self, app: &mut App) {\n        for ty in &self.order {\n            if let Some(entry) = self.plugins.remove(ty)\n                && entry.enabled\n            {\n                debug!(\"added plugin: {}\", entry.plugin.name());\n                if let Err(AppError::DuplicatePlugin { plugin_name }) =\n                    app.add_boxed_plugin(entry.plugin)\n                {\n                    panic!(\n                        \"Error adding plugin {} in group {}: plugin was already added in application\",\n                        plugin_name,\n                        self.group_name\n                    );\n                }\n            }\n        }\n    }\n}\n\n/// A plugin group which doesn't do anything. Useful for examples:\n/// ```\n/// # use bevy_app::prelude::*;\n/// use bevy_app::NoopPluginGroup as MinimalPlugins;\n///\n/// fn main(){\n///     App::new().add_plugins(MinimalPlugins).run();\n/// }","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_app/src/plugin_group.rs#L558-L594","documentation":"Panics during PluginGroupBuilder::finish when adding one of the group's enabled plugins to the App returns AppError::DuplicatePlugin: that plugin type was already added to the application earlier (directly or via another group). The group build is aborted at the first duplicate encountered.","triggerScenarios":"Thrown at crates/bevy_app/src/plugin_group.rs:576 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the earlier direct app.add_plugin call for plugin types that are also part of this PluginGroup","Avoid adding overlapping PluginGroups that contain the same plugin type","Disable the duplicate plugin in one of the groups (e.g. DefaultPlugins.disable::<T>()) instead of adding it twice"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}