Reputation: 779
How can I reset Android/iOS project in React Native? Like in Ionic, we can use "ionic platform rm android" & then add it again, so it will add fresh project. How I can do same in React Native?
Upvotes: 1
Views: 6772
Reputation: 6568
To reset android build, delete cache and refresh you may need to do the following
If you have already generated signed keys and updated those in the gradles, you can build the production build, unless you can build the developer build (debugging apk)
build
inside android/app
folderbuild
inside android
folderrm -rf $HOME/.gradle/caches/
to delete cachebuild.gradle
-> android/app/build.gradle
apply from: "../../node_modules/react-native/react.gradle"
index.android.bundle
file from assets
folder ( android/app/src/main/assets/index.android.bundle)
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android --variant=release
(you have to generate signed keys and all the keys should updated in the gradle file ref (https://s-pace.github.io/react-native/docs/signed-apk-android.html)react-native run-android
Upvotes: 1
Reputation: 10794
I had issues with Pod dependencies or Cocoapods in iOS. Removing and de-integrating CocoaPods from my project fixed it.
gem install cocoapods-deintegrate
cd ios
pod deintegrate
pod install
https://github.com/CocoaPods/cocoapods-deintegrate
Upvotes: 4
Reputation: 1575
Just remove folder ios/build
for ios, and android/build
. For android you may also need cd ./android && ./gradlew clean
in some cases.
If you can create command inside package.json
like
"clear-android": "rm -rf android/build",
"clear-ios": "rm -rf ios/build"
Upvotes: 1