Sen. Elizabeth Warren (D-Mass.) worked for years to build relationships with black leaders, an effort that included becoming one of the first white politicians to endorse the Black Lives Matter movement.

But when she got in trouble recently for releasing a DNA test that struck many as racially insensitive, few black leaders rushed to her defense.

The episode suggests a lack of depth in the alliances she has forged among nonwhite activists and influencers, a group that she must lean on to vouch for her should she go ahead with a presidential bid.

It’s difficult to see a path to nomination without some support from black voters. More than 8 in 10 African Americans identify with or lean toward the Democratic Party. In 2016, African American voters made up 62 percent of the electorate in South Carolina, a key early-voting state.

In 2016, black voters were essential to Hillary Clinton’s nomination. That task will be far more difficult for Warren and any other white Democratic candidates in 2020 because of the potential presence of at least two black senators, Kamala D. Harris of California and Cory Booker of New Jersey.

“African Americans are a strong constituency in the Democratic Party, in fact the most loyal voting bloc in the party, and she is not so well-known or connected — that I know of,” said Antjuan Seawright, a South Carolina-based Democratic operative who advised Clinton’s 2016 campaign in the state.

“We want to feel appreciated. We want to feel courted,” he said, noting that he’s heard from a number of potential Democratic candidates, but not from Warren. “You can’t come in as a fly-by-night candidate and expect to garner support just because you show up.”

Adding to the disconnect is Warren’s geographic base. Her home state of Massachusetts is largely white; its capital and the probable area for Warren’s campaign headquarters is Boston, a city whose long history of racial strife makes it shorthand for racism among many blacks.

As one Democratic congressional staffer put it, the city of Boston is seen as “the Mississippi of the North.”

Another difficulty stems from Warren’s fraught relationship with her racial identity. As a politician, she has stumbled over a claim made during parts of her earlier teaching career that she was a Native American.

In response to gibes from President Trump, who belittled her as “Pocahontas,” she recently released a DNA test that showed she may have a distant Native American relative. Minority groups responded by criticizing Warren as seeking to define ethnic identity by a blood test.

Few black leaders defended Warren after she made the test public in October. Although, former interim Democratic National Committee chairwoman Donna Brazile tried to pivot away when asked about it: “You want to know what’s in her DNA?” she said on MSNBC. “A willingness to fight for our democracy.”

As Warren has prepared for a presidential run, she has expanded the top ranks of her staff to include minorities in key positions. In the spring, she added Christopher Huntley, who is black and previously worked for Rep. Barbara Lee (D-Calif.), as her speechwriter.

Over the summer, she hired Anne Morris Reid, a former Obama administration official who is black, as a senior adviser in her Senate office; Reid was recently named chief of staff. LaToia Jones, a black Democratic strategist, has acted as a consultant for the past year.

Warren, whose two Senate victories relied on help from minority voters, has in turn been loyal to her minority staff. Dan Rivera, mayor of Lawrence, Mass., helped her with Latino outreach. He won his race after she endorsed him over a sitting Democratic mayor.

Warren also backed former campaign staffer (and her former law student) Michelle Wu in her successful bid to became Boston City Council’s first Asian American member.

Warren’s efforts to demonstrate her affinity for black voters and their leaders have had mixed results.

A high point in their relationships came in the summer of 2015, when Warren stood on a stage at a meeting of liberal activists in Phoenix and uttered the controversial words the party’s then-presidential candidates, Sanders and Clinton, were struggling over: “Black Lives Matter.”

She followed up in September 2015 with a speech on racism at Harvard University that was hailed as a “landmark” speech by the liberal magazine The Nation.

But some remaining awkwardness was on display earlier this month at the Capitol, when she and the Congressional Black Caucus chairman, Rep. Cedric L. Richmond (D-La.), held a news conference about his plans to introduce a House version of Warren’s $500 billion bill intended to vastly increase affordable housing.

Warren focused on the camera angle, instructing Richmond and Rep. Gwen Moore (D-Wis.), who is also black, to “come stand behind” her from the podium.

Later, when Moore’s face was obscured by another speaker, Warren extended her right hand and pulled the Wisconsin Democrat closer to her and into the spotlight.

The theatrics didn’t bother Richmond. In a brief interview, he brushed aside the lasting impact of Warren’s DNA test. “In communities of color, we look at your body of work,” he said. “We don’t look at one blip in time. Her body of work is a body of work that is very supportive of minority communities.”

During the news conference, he labeled Warren a “policy genius” and said later that the two frequently text each other — evidence that some of Warren’s outreach has been fruitful.

Warren stuck closely to her prepared speech last month when she gave a commencement address at Morgan State University, a historically black university in Baltimore. “We need to stop pretending that the same doors open for everyone. Because they don’t,” Warren said, prompting applause.

“Rules matter, and our government — not just individuals within the government, but the government itself — has systematically discriminated against black people in this country.”

She talked about predatory lending and discriminatory housing policies that have hurt black communities, and she earned rave reviews from African American attendees.

But there’s a difference between appreciating the speech and being ready to back a presidential bid. One audience member said the flap over Warren’s DNA test should disqualify her from the presidential field.

“We need somebody squeaky clean to run in 2020 to ensure a victory over this anti-constitutionalist president,” said Kevin Bailey, 63, who came to see his daughter graduate.

The DNA test hit him personally, he said. “I did my DNA, and I’m 19 percent English,” he said. “But I can’t claim I’m white.”

David Weigel and Scott Clement contributed to this report.

‘Get ready, because reform is here’: Lori Lightfoot is sworn in as Chicago’s 56th mayor

She is the city’s first black female leader as well as its first openly gay one

When did we decide the best presidential candidate is the one you’d want to have a beer with?

Women can be likable on entirely different terms, and those terms are equally valid