All paths through the code must lead to a return statement. Some analysis of this code indicates that it should always do so, but this requires knowing that for (int i = 0; i < 1; i++) will loop at least once.
The compiler isn't going to go that far. Hence, this won't compile. Just reorder a few things and it will. Separately, you also have a second issue - == checks reference identity, it doesn't do value comparison. Unless the left and right hand side are primitives (i.e. not references, and thus 'reference identity' wouldnt apply in the first place). You use equals instead, or in this case, more idiomatic, .isEmpty(). Fixing both issues:
public static String agregarMain() {
    Scanner in = new Scanner(System.in);
    String mainSeleccion = "";
    for (int i = 0; i < 1; i++) {
        System.out.println("Ingresar nombre del software/topico");
        mainSeleccion = in.nextLine();
        if (mainSeleccion.isEmpty()) {
            System.out.println("Invalid Selection, please try again");
            i--;
        }
    }
    return mainSeleccion;
}
NB: When asking question on stack overflow, include all pertinent errors. You didnt which led to some confusion in the comments and got your question closed.