简体   繁体   中英

React-native app offline with android studio

I'm develeoping react-native app on a computer without internet connection(I can't connect it to the internet),

I have configure the local repository and the android plugin according to android studio guide here

and also linked the gradle localy.

All the configures worked fine but the project is still not compiled, I get unresolved dependencies of the react native modules( example here ) that I used.

I'm trying to solve this issue for two weeks and failed.

I didn't find any solution for this yet

The android studio version is 3.5.2 and the gradle version is 5.4.1

Any idea? Any help would be appreciated

Well, working offline with gradle will prove a little hard unless you build the project once when you have internet. The problem is that gradle needs to resolve the dependencies and for this it's not only looking in node_modules, but also at different online repositories.

If you don't have internet - gradle isn't able to fetch the required packages and you get a build error.

In your case you've configured android studio to use offline versions of gradle and maven, but what your build can't find is soloader, yoga etc - those are libraries that are not available in the offline maven build you downloaded. As far as I can see from the content of that build it only contains the android dependencies.

You'll need to get the soloaded, yoga etc and provide those to your build for offline use. I guess that the easiest thing would be to build the project once when online... Afterwards gradle should reuse the cached packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM