sandarshnaroju / react-native-nano

Build mobile apps in JSON
https://nanoapp.dev
87 stars 5 forks source link

Error #13

Closed beyons closed 4 months ago

beyons commented 4 months ago

Hello, i have update react-native nano to the last version and add react-native reanimated but i have this error now

image

sandarshnaroju commented 4 months ago

Hey , We need more info to help you. 1) Which version of react-native-nano are you using?? 2) It looks like you are trying to update react-native-nano, can you tell us more info about from which version you updated it to the latest one. For installing and using react-native-reanimated separately, you have to add react-native-reanimated/plugin in the babel.config.js. check if you have done that. More details can be found react-native-reanimated.

One more thing you need to know is, usage of React-native-nano also changed in the latest versions from

// usage in old versions
import {RNNano} from  'react-native-nano';

const  App = () => {
    return <RNNano screens={[screen]} />;
};
export  default  App;

to


// usage in new and updated versions
import {NanoApp} from  'react-native-nano';

const  App = () => {
    return <NanoApp screens={[screen]} />;
};
export  default  App;

So, if that is the problem.

Easiest way forward for you is using npx rn-nano init MyAwesomeApp and replacing the JSON code in the new app. Here you don't have to install react-native-reanimated separately. It is installed and setup automatically. With this way, everything works as expected.

To use Animations with react-native-nano, checkout our updated docs at docs.nanoapp.dev .

beyons commented 4 months ago

Hi when i added the last version of react native nano and added reanimated my previous version [1.0.157] when i update react native nano to the last version and add reacnimated i have this error ,

this error is from reanimated library because without this library i can build the apk but with this library i cannot

beyons commented 4 months ago

strange when i used this command i have this error now ( 4 pc with same error )

image

and in my node module i dont have all dependencies

image

beyons commented 4 months ago

and this is package.json

image

sandarshnaroju commented 4 months ago

Based on the error, it looks like npm wants to access a file , but that file is being used by another program.

As per a similar issue here You can try npm cache clean and rerunning the command npx rn-nano init Myawesomeapp. or Try to run command with run as administrator in command prompt. If that doesnt work, try to rerun the command after turning off your antivirus and also closing vscode or any other file editors.

beyons commented 4 months ago

a new error now image

actually i downgraded my apps to 1.0.157 and my apps work but when i update react native nano i have problem with react native reanimated

sandarshnaroju commented 4 months ago

Did you try above three solutions??

beyons commented 4 months ago

Yes all three didn't work for me and i cannot create a new app because i have this error in all the pc

sandarshnaroju commented 4 months ago

I am working on it. will get back to you as early as possible.

sandarshnaroju commented 4 months ago

Ok, The problem seems to be from compatibility issues between different versions of react-native and react-native-reanimated. You have two options now.

If you are ok with using little older React-Native version(0.71.4) you can directly use npx rn-nano init awesomeproject --react-native-version 0.71.4. Generated project will have react-native-reanimated (3.6.2) installed. Everything works as expected.

If you want to use the latest React native version(0.74.0) , first do npx rn-nano init awesomeproject and then update react-native-reanimated via npm install react-native-reanimated@3.9.0. Finally go to presets in babel.config.js and replace module:metro-react-native-babel-preset with @react-native/babel-preset. Run the app and everything should work as expected.

I will update the rn-nano cli-tool code so that these compatibility issues wont happen in the future. but that will take some time. Till then you can follow the above methods. Let me know how it went.

beyons commented 4 months ago

hi when i creant with npx rn nano init i have this error

image on windows i dont have all moduls like react native nano and reanimated in node module but in chrome os i have all moduls

sandarshnaroju commented 4 months ago

What command did u run?

sandarshnaroju commented 4 months ago

Try it now, should work

beyons commented 4 months ago

HI it work form me i can create project with npx rn-nano init awesomeproject --react-native-version 0.71.4 on windows and on chrome os in all my pc

sandarshnaroju commented 4 months ago

Thanks for replying. I am closing this issue now. Feel free to open new issues if you encounter any other problem.