Deuteronomy 26:12-15 details a confession that must be recited on the final yontef of Pesach, both on the fourth and on the seventh years of the agricultural cycle, at such a time as there is a temple in Jerusalem. The nature of the confession is detailed in the Mishna, Ma'aser Sheni 5:10-14, where various stipulations are enumerated, the absence of any of which renders one unable to make the necessary declaration. One of these stipulations is that one has given one's first tithe to the levites.
The mitzva of reciting the Vidui Ma'aser (the "confession of the tithe", as it is known) is found as a positive mitzvah in Rambam's Sefer haMitzvot #131, as well as in Sefer haChinukh #607. In Sefer haChinukh, the author concludes by noting,
ועובר על זה ולא התודה וידוי זה של מעשרות בזמנו בזמן הבית ביטל עשה זה
Whoever transgresses this and does not make this confession over tithes in its time, at such a time as there is a temple, nullifies this positive mitzvah.
That said, both Ma'aser Sheni 5:15 and Sotah 9:10 record the tradition that Yochanan Kohen Gadol abolished this practice altogether! The phrase in question merely reads that יוחנן כהן גדול העביר הודית המעשר (Yochanan Kohen Gadol abolished the confession [lit. the thanksgiving] of the tithe), but fails to provide a reason. The gemara in Yevamot 86b explains this tradition as follows:
מפני מה קנסו לוים במעשר פליגי בה רבי יונתן וסביא חד אמר שלא עלו בימי עזרא וח"א כדי שיסמכו כהנים עליו בימי טומאתן
Why were the levites fined as regards [their] tithe? Rabbi Yonatan and the elders disagreed. One said that it was because they didn't ascend [ie: return] with Ezra and one said [that it wasn't a fine, but in order] that the kohanim could rely upon it [ie: have something to eat] during the days of their impurity.
According to Rashi (s.v. מפני מה), this question presupposes that the levites in the days of Yochanan Kohen Gadol were not being given their tithe - either as the result of a fine instituted by Ezra or as a measure designed to ensure that the kohanim always have something to eat. Once we appreciate that the levites were not being given their tithe in the time of Yochanan Kohen Gadol, we can understand why he needed to abolish the Vidui Ma'aser. As the Bartenura explains:
לפי שעזרא קנס את הלוים שלא יתנו להם מעשר, כשעלה מן הגולה ובני לוי לא עלו עמו, וצוה שיתנו המעשר לכהנים. ויוחנן כהן גדול בטל הוידוי, כיון שאינו יכול לומר וגם נתתיו ללוי
Ezra fined the levites that one should not give them [their] tithe, since he ascended from the diaspora and the levites did not go up with him, so he commanded that one should give the tithe to kohanim [instead]. So Yochanan Kohen Gadol nullified the confession, since one is no longer able to say, "And I gave it to the levite" (Deuteronomy 26:13).
- Bartenura, Ma'aser Sheni 5:15, s.v. העביר (≈ Sotah 9:10, s.v. הודיית מעשר)
Consider as well what the Rambam writes in Hilkhot Ma'aser 1:4. The relevant part reads as follows:
ועזרא קנס את הליום בזמנו שלא יתנו להן מעשר ראשון אלא ינתן לכהנים לפי שלא עלו עמו לירושלם
Ezra fined the levites of his day, that one should not give them the first tithe, but rather give it to the kohanim, since they [the levites] did not ascend with him to Jerusalem.
Here, the Rambam only says that Ezra fined the levites "of his day" (בזמנו). One of the earliest manuscripts of the Mishne Torah, MS Kaufmann A77 (produced in Northern France, 1296), omits the word בזמנו - thus possibly testifying to the opinion that Ezra had instituted this punishment for all time and not just for his own. This alternative nusach can be found in the ילקוט שנויי נוסחאות appended to the Fraenkel edition of the Mishne Torah. In the actual manuscript, it is to be found in fol. II.142v, and can be viewed here in the ninth line of the leftmost column.
This all raises two questions:
If Ezra's enactment remained in effect until the time of Yochanan Kohen Gadol, then why was it necessary for him to also enact legislation that enabled people to purchase produce from somebody suspected of not giving tithes to levites (Sotah 48a)? If Ezra's enactment did not remain in effect until the time of Yochanan Kohen Gadol, how can it be used as a reason (as per Rashi and the Bartenura) for his abolishing the Vidui Ma'aser?
If Ezra's enactment remained in effect until the time of Yochanan Kohen Gadol, then what was it that gave Ezra the right to do something that would lead to abolishing an explicit Torah mitzvah? A prophet is allowed to encourage people to temporarily violate a Torah mitzvah, but if he has them violate it perpetually he is liable to death by strangulation (cf: Rambam, Yesodei haTorah 9:3).