That's only a problem if God has always been all knowing, however, in Genesis God seems very surprised to learn of A/E's sin. He may have known it was possible, but knowing something is possible is not the same as knowing it happened. When you know something's possible, you put measures in place to prevent it, which God did in Genesis, yet they still sinned.
It seems to me that the opposite is true.
Instead of putting in measures to prevent it, it seems he rather put in measures to make sure it actually happened.
First, he creates clueless humans. "Clueless" in the sense of not knowing right from wrong and being some kind of blank slates.
Then he puts a tree in the middle of their home with nice looking fruit and tells them not to touch it. Like putting candy in from of a 3-year old that he can't touch. I have a 3-year old: I guarantee you that eventually, he'll take the candy.
On top of it all, he also allows the very embodiment of evil in said garden, who's free to talk to them and try and get them to eat the fruit anyways.
That would be like putting a baby sitter next to that toddler who can't touch the candy, who keeps telling the toddler that it's okay to eat the candy.
What did you think was going to happen?
How is this "taking measures to prevent it"?
Taking such measures would rather be, NOT putting the candy there or at the very least, not allowing someone in there who keeps telling the toddler that it's okay to eat the candy - and of whom you actually KNOW would make it a sport to make the toddler eat the candy.
So, I suggest that the very opposite of your claim is true.
He didn't put in measures to prevent it. Instead, he did everything he could to make it happen, short of himself saying they should eat the fruit.
The entire story reads like a gigantic trap. They never really stood a chance.