In this study, a realistic flexible or hybrid flowshop scheduling problem (HFS) is investigated, in which the following constraints are embedded, i.e., resource-dependent processing, robotic arm loading, and transportation. To solve the considered problem, a multi-dimensional co-evolutionary algorithm (MDCEA) is proposed to minimize makespan and total energy consumption (TEC) simultaneously. First, in the MDCEA, solutions are encoded by a three-dimensional vector with a two-phase decoding heuristic. Then, the initialized population is divided into three subsets to focus on different search tasks. To improve the efficiency of the global search task, a dual-population-based variable dimension cooperative search method is developed. In addition, to explore the promising non-dominated solutions in different dimensions, a Q-learning-based dimension detection search method is designed for the local search task. Finally, to keep the diversity in the evolutionary process, a knowledge-based individual transfer strategy is conducted for populations. The proposed algorithm was tested on 25 randomly generated instances, and detailed comparisons verified the efficiency and robustness compared to six state-of-the-art algorithms was achieved.