Sen. Elizabeth Warren (D-Mass.), left, talks to American University law professor Brenda Smith. Warren addressed its law school in November. (Andrew Harnik/AP)

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, and on average, 25 percent of the primary voters and caucusgoers in the last presidential contest were black. In 2016, African American voters made up 62 percent of the electorate in South Carolina, a key early-voting state. They also make up a large share of the vote in southern states that cast ballots on Super Tuesday or later in the calendar.

In 2016, black voters were essential to Hillary Clinton’s nomination, with 78 percent siding with her over Sen. Bernie Sanders (I-Vt.) (in primaries and caucuses where exit polls were available). 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.

Warren has been traveling around the country to speak in front of black audiences, added black staffers in key roles, and cultivating key black leaders. But there remains an awkwardness she hasn’t quite addressed, according to strategists who focus on the demographic.

The reasons include her message of economic populism that can clang in the community, her ties to Boston and her DNA test, which dredged up ugly reminders about defining ethnicity.

“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.”

The economic populist agenda Warren champions doesn’t always connect with black communities because it can be seen as de-emphasizing racism as a root problem for inequality, black leaders say, even though Warren has gone out of her way to underscore the impact of racism among communities of color.

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.”

Others have been far more blunt. “She would have done much better not to address Trump’s racism,” said Aimee Allison, the executive director of She the People, a group that supports nonwhite female candidates.

Allison’s group released a straw poll of black female activists and strategists earlier in December that illustrated how much work Warren has ahead of her among those influential leaders. Just 22 percent picked Warren as one of their top three candidates.

Among those who finished ahead of Warren were potential black candidates Harris and Booker. But Warren was also behind two possible contenders who are white: One was Rep. Beto O’Rourke of Texas, who during his unsuccessful U.S. Senate campaign offered a full-throated and later viral defense of NFL players who take a knee during the national anthem. The second was Joe Biden, vice president to the nation’s first black commander in chief.

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.

“We just swap ideas often,” Richmond explained.

Richmond was her host last August at a town hall meeting at Dillard University in New Orleans, at which Warren’s off-the-cuff rhetoric about race turned into an issue for her November reelection campaign.

“Let’s just start with the hard truth about our criminal justice system,” Warren said during the meeting. “It’s racist. I mean, all the way. I mean, front to back.”

Republican opposition researchers clipped those remarks into a short video, which became fodder for police unions in Massachusetts and for her Republican opponent, Geoff Diehl, who insisted she was “calling our law enforcement officers racist.”

Even some of Warren’s black supporters in Massachusetts were taken aback.

“Some people were offended by it,” said Suffolk County Sheriff Steve Tompkins, who worked on Warren’s 2012 Senate campaign before launching his own political career with her endorsement. “I think folk of color took it with a grain of salt. If you’re black or Latino, it can be tough out there.”

Warren stuck closely to her prepared speech last week 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.

“She was right about how some people in Washington, D.C., are treating us a little bit differently,” said Arnold Nelson, 57, of New York. “She gets it. She understands us.”

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.