Search This Blog

Thursday, September 22, 2022

React Naitive TypeError: cli.init is not a function - Solution Fix

Because of recent version has bugs, so downgrade to previous version like below.

 npx react-native init <YourProjectName> --version 0.68.2

Unable to resolve module react-native-reanimated


step 1. npm i react-native-reanimated


step 2. add plugin babel.config.js


module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
   plugins: [
          'react-native-reanimated/plugin',
      ],
};

step 3 When trying to run the code after close the terminal I still I'm facing same issue

  Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin


step 4. After that, i close the current terminal and run this command

npm start -- --reset-cache 


Enjoy !

Tuesday, September 20, 2022

AVD - Android Emulator Device Slow Process Solution !

 1. Open <Project>/android/build.gradle

2. add jcenter() and add mavenCentral() before each of them (Make sure to add mavenCenteral() in both spots where jcenter() is found.)

2.1   repositories {

        google()

        mavenCentral() // New line

        jcenter()

       // NOTE: Keep any other entries you may have had here

    }


2.2 allprojects {

    repositories {

        google()

        mavenCentral() // New line

        jcenter()

       // NOTE: Keep any other entries you may have had here

    }

React Native TypeError: cli.init is not a function Error !

1. Dont use react-native init <ProjectName>


use like below.

npx react-native init YourProjectName --version 0.68.2



Monday, September 19, 2022

Android Virtual Device - AVD Setup

 1. Install Andriod SDK

2. Set environment for ANDROID_HOME=/home/android/sdk...

3. Install AVD or Android Studio

4. Open Android Studio 

           /home/android-studio/bin/

                        ./studio.sh


5. In that android Studio, you can see Configure Button -> AVD



6. Create Virutal Device or AVD like below. 



7. Start The Emulator by click Play button



8. Add environment variable.

      8.1  goto /etc/profile.d/    [create one file.sh] ex: > sudo vi myenv.sh
         
      export ANDROID_HOME=$HOME/Library/Android/sdk
      export PATH=$PATH:$ANDROID_HOME/emulator
      export PATH=$PATH:$ANDROID_HOME/tools
      export PATH=$PATH:$ANDROID_HOME/tools/bin
      export PATH=$PATH:$ANDROID_HOME/platform-tools

9. > source /etc/profile




Hit Counter


View My Stats