It seems possible that the expression in its figurative sense entered English as a direct translation from an existing French expression. In any event, the earliest instance of an allied expression that I've been able to find through Google Books and Hathitrust searches is this one from David Macdonnel, A Dictionary of Quotations, in Most Frequent Use: Taken Chiefly from the Latin and French, but Comprising Many from the Greek, Spanish, and Italian Languages, eighth edition (1822):
Mettre les points sur les í. Fr.—"To dot every i." To be scrupulously exact.
Macdonnel's dictionary was published in multiple editions in Britain and in the United States at least as late as 1845.
The earliest instance of "in the wild" usage of a related English expression that I've found is from "The Letter-Writer," in the New-York Mirror, and Ladies' Literary Gazette (January 21, 1826), where the meaning of the phrase seems to be more or less literal:
Adieu! my dear Gay; write to me as soon as you receive this, and enclose me the letters which I wrote to you when on my travels to the west. I have found in Mr. George P. Morris a very pleasant and good humoured acquaintance, who has promised to cross all the t's and dot all the i's, and to publish the letters in his paper.
Another early occurrence is from "Gen. Jackson's Literature," in the [Washington, D.C.] United States' Telegraph (April 26, 19828):
But to the letter [from Andrew Jackson to Mr. Campbell, a Congressman]. It will be seen that it was a private letter, written to a confidential friend—and, as evidently appears from its face, a letter written in the haste and carelessness of private confidence. It is true that General Jackson did not stop to dot every i, or to cross every t. ...
We ask every reader to take up the letters of the first men in the nation, and examine them carefully, and see how few there are that cross the t and dot the i. ...
The usage here is again literal, centering on a controversy over whether Jackson's tendency to leave certain letters incompletely formed was a sign of more general sloppiness or illiteracy on his part.
A third early instance appears in a letter written in Washington D.C. and dated February 17, 1830, from Thomas Newton to Willis Alston, Chairman of the Committee of Elections, reproduced in Loyall vs. Newton (February 19, 1830), reprinted in Cases of Contested Elections in Congress: From the Year 1789 to 1834, Inclusive (1834):
If the commission of errors in orthography be a reproach, it will attach to many who, though they may not possess the orthographical skill and pedantry of a pedagogue, derive from their nature strong minds and honest hearts. Some men there are, who, supply every word in every letter, dot every i, and cross every t, but whose words never represent ideas. The magistrates who presided in taking depositions, rank among the most respectable of our citizens. Where they are known, they are esteemed by those whose esteem is worth having; their services are performed without fee or reward; their honors do not flourish in rich and splendid ores; their consciences and their patriotism make them evergreens. In the presence of such men my depositions were taken.
From "About Letters" in The American Monthly Magazine (September 1830):
So would I write a letter; and whoever would do so would never complain—'I am no letter-writer.' And yet how many always write a letter as if it were an essay for the New Monthly—erasing here, and supplying there, dotting every i, and crossing every t with the most exact precision. Oh, deliver a formal letter!
Yet another early instance occurs in Charles Dickens, The Life and Adventures of Nicholas Nickleby (1839):
"He has done it," said Tim, looking round at his employers and shaking his head triumphantly. "His capital B's and D's are exactly like mine; he dots all his small i's and crosses every t as he writes it. There an't such a young man as this in all London," said Tim, clapping Nicholas on the back; "not one. Don't tell me. The City can't produce his equal. I challenge the City to do it!"
One early figurative instance of the expression appears in "Excellence," in Francis Davis, The Belfast Man's Journal (February 2, 1850):
The characteristic of a truly great man is to be great in trifles, as it were to dot all the i's and cross all the t's in the scripture of his life, it should be universal, find scope in everything, in making pins, painting pictures, cleaning houses, carving statues, ploughing, or writing poems: nothing too high to be above its flight, nothing too low to be beneath its stoop; the central force of advancement, it should be to humanity what the laws of gravitation are to the earth, controlling, with equal power, the atom and the orb; ...
Another occurs in remarks by Senator Dodge of Iowa in Appendix to the Congressional Globe (March 3–4 and 8, 1852):
[Mr. DODGE of Iowa.] Mr. President, if I were disposed, on an occasion like this, to complain of my friend from Kentucky, {Mr. Underwood,} it appears to me I could do so with great justice. We are both members of the Committee on Public Lands, and, as I have already stated, my colleague introduced this bill on the second day of the session, and it is number one upon the calendar. The bill was detained several weeks in committee, expressly to allow that Senator to mould and shape it to suit his own views, no other member of the committee having any objections to the form in which it was sent to us. To this, I willingly acquiesced, because I understood him to be a friend of the bill, and I was anxious to harmonize with him, expecting, as he had dotted every "i," and crossed every "t" in it, that we should have his aid in carrying the bill through the Senate. Judge, then, sir, what was my surprise and regret when he moved his "omnibus" amendment to the Iowa bill, a part and parcel of his own work; and that, too, after sitting in his seat, and allowing a bill precisely similar in all its features to be passed without its ever having been examined or reported upon by any committee, as an act of courtesy to a retiring Senator, {Mr. Foote,} now no longer a member of this body.
...
Mr. DODGE of Iowa. Mr. President, if the Senator will permit me to interrupt him, I will say that I never mentioned the word Southern or Northern when I made the allusion. Those were not words that entered into my speech upon the bill. I made no intimation of that sort. I did charge, as though I thought it was unkind in him, my associate upon the committee—he being the author, as it were, of the bill, having dotted every "i," and crossed every "t"—to allow a bill of that sort, precisely the same in its features, to pass and to offer this tremendous amendment of his to ours. But I never mad any insinuation about the North or South, nor would anything of that sort attach to the Senator.
By the middle 1800s, the practice of dotting i's and crossing t's was appearing in pedagogical works as a fundamental habit of properly inmstructed children. For example, from William Tweedie, Daily Duty: A Book for the Nursery, Fireside, and School (1855):
I do not mean that you should be careless in writing. By no means. Be careless in nothing. All your life make it a rule to do everything as well as you can. Take a fair sheet of purely white paper. Be sure you have a perfectly good pen, and the very blackest ink. Get your mother to shew you where to begin, where the date is to be, and how far from the top you should write the little opening salutation. Leave a sufficient blank margin. Take pains to spell every word right, and to place your commas and other stops exactly; to dot every i, and cross every t. Learn to close and sign your name in a becoming way. Do not delay to find out the neatest and most elegant mode of folding and sealing your letter, and direct it on the outside in a fair, legible hand. Do every part of this with your own hands.
Conclusions
It is easy to see how the practice of dotting all i's and crossing all t's might be taken as symptomatic of a more general diligence, consistency, and attention to detail. The criticism of Andrew Jackson in 1830 for supposedly leaving his letters incomplete indicates rather more concern over this practice as an indicator of character than one might expect.
But while figurative use of the expression "dot every i and cross every t" arises somewhat later than literal use—at least in the examples I found—David Macdonnel expressly notes the figurative meaning of "mettre les points sur les í" in French in a dictionary of foreign phrases published in 1822, several years before the earliest confirmed instances of "dot every i" appear in English in any other context. The use of an extended version of the same expression to convey precisely the same figurative sense—"To be scrupulously exact," as Macdonnel puts it—in English as in French is, at the least, an interesting coincidence.