If you thought that Todd Phillips’ 2004 send-up of the 1970s TV buddy-cop show “Starsky & Hutch” was s great idea, you should also take to this spoof of the 1980s Fox series, which has virtually nothing to do with the original apart from the basic premise of cops going undercover in high schools and Johnny Depp, who had his breakthrough part starring on the program and appears here in a cringe-inducing cameo.

This time around, the earnestness of the show, which was already not a little absurd (especially in retrospect), is replaced by the goofy, raunchy dumb-guy humor that dominates virtually every Hollywood comedy released nowadays. The joke is that a couple of doofus rookies, just out of the training academy, blunder badly on their first tour of duty and are abruptly assigned to the titular special unit—roused from hibernation—to pose as students and break up a drug ring believed to be operating in the vicinity. But since handsome jock Jenko (Channing Tatum) and nerdy Schmidt (Jonah Hill)—who bonded during training—both have reason to look back at their school days with varying degrees of dissatisfaction (Schmidt was an outcast and Jenko an underachiever who was banned from prom), they opt to use the stint to relive them they way they should have been in the first go-round, rather than follow police protocol. Much wild-and-craziness follows.

The movie works best as a fish-out-of-water lark. Both guys are obviously way over high school age—whatever their frazzled superiors, Deputy Chief Hardy (Nick Offerman) and predictably volcanic Captain Dickson (Ice Cube), might think—and the reaction of students and school officials alike to them is a promising gag. So too is the idea that time has already passed them by to such an extent that the campus is like a foreign territory, a place where political correctness is a must and laissez-faire rules. In such an environment it’s the two “authority figures” who prove to be the bulls in the china shop.

But of course subtlety has no place in a movie like this, so raucous slapstick, vulgar language and gross-out sight gags predominate, along with a soundtrack that blasts away at dangerous decibels. There’s a depressing predictability about it all—especially in the inevitable party scene—that makes “21 Jump Street” feel like an address we’ve visited all too many times before in similar buddy-cop and teen comedies.

Still, Hill and Tatum manage a sense of camaraderie that often escapes teams in such fare. The former, reverting to “Superbad” form following his more restrained turns in “Cyrus” and “Moneyball,” does the brainy-guy-with-no-street-smarts routine well enough for the first hour, and the latter at last sloughs off the sense of physical discomfort he exhibited in pictures from “G.I. Joe” to “The Vow” to show the agreeably unforced, natural side he was once capable of. The supporting cast isn’t pushed especially hard, but Dave Franco—James’s younger brother—shows the broad familial smile as the leader of the “in” crowd on campus, and Ice Cube has a fine time as the fierce Captain.

Unfortunately, in the last forty or so minutes the movie collapses, first as the partners’ bond unravels and they have to reconnect, and then as they go into action to deal with the villains. Simply put, the car chases, slapstick fights and shootouts Michael Bacall’s script comes up with are pretty much laugh-free (except for a depressingly ugly gross-out gag featuring an over-the-top Rob Riggle, which the yahoo crowd will applaud but anybody with a shred of taste left will find repulsive), and directors Phil Lord and Christopher Miller, who have a background in animation, are incapable of choreographing them well. The frenetic closing reel is really a mess.

Near the start of “21 Jump Street” Ice Cube delivers a conspiratorial in-joke even the dimmest viewer will understand, about recycling crap from the past and expecting people not to notice. For its first half this movie does a reasonably clever job of reinvention, though the crudeness level is excessive; but the second half jumps the rails.