Gradle cannot resolve dependency even dependency cached in caches\modules-2\files-2.1

device A can access repositories via network, so A can build and compile project success, but device B cannot access these repositories for some reason, so I copied gradle cache to B from A, but gradle cannot resolve dependency, even dependency jar file exsits in caches\modules-2\files-2.1, how can I revole this problem?
thanks a lot

You cannot copy all Gradle caches.
You can indeed copy the dependency cache, if the Gradle version is recent enough (6.1 or newer) and if you do it correctly.
You can read more about it at Gradle User Manual: Version 7.1.1.

thanks, so is anyway gradle cache all dependency transform to localmaven, so device B can use these dependency via localmaven

Does that mean you are on a Gradle version older than 6.1?
Or why do you want to use local maven repo now instead of copying the copyable part of the cache as documented?