I am using ViroARSampleApp code to demonstrates placing, rotating and dragging objects in AR. Everything is working fine when I run react-native run-android --variant=arDebug but when I detach data cable and run the app then the application is running fine but objects are not rendered.
I tried to make proper APK file and install to the device but facing the same issue. I tried these commands to make build 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/, cd android, ./gradlew assemblearDebug. i also tried ./gradlew bundlearDebugJsAndAssets.
I am new in react native and AR, kindly suggest me the solution for this issue.
try this
./gradlew assembleGvrRelease
Related
I'm struggling with this issue where I can't generate a APK locally with my coded changes in a React Native 0.67.2 project.
I already did run some of those commands down below to generate a new updated bundle:
npx react-native bundle --entry-file index.js --platform android --dev false --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res
But everytime after running npx react-native run-android --variant=release, it installs an older version of my project.
If I just run it as default npx react-native run-android, which is as debug it works perfectly and install the updated version on my emulator.
It doesn't makes any sense to me, what am I doing wrong?
Try using this command to generate a new APK :
cd android && ./gradlew clean assembleRelease -PMYAPP_UPLOAD_STORE_PASSWORD=foo -PMYAPP_UPLOAD_KEY_PASSWORD=foo
And you'll find it in
yourProject/android/app/build/outputs/apk/debug/app-debug.apk
I was getting one error :
Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release
So I have fired this command :
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
So that error gone, but Now problem is I am not able to debugging. If I am using react-native start command then also in not bundling.
So main problem is I am not able to bundle application.
Please guide on this point.
Thanks.
I am getting this error.
Points :
You can still debug on logcat in android studio or Xcode.
run react-native run-android in one terminal and react-native start in another terminal
Please check whether the port is 8081 if not then change it in the dev setting in adb by adding your local pc ip.
Delete node modules and try updating your metro bundle. Then install them. Hope this will work!
Sometimes the metro bundle hangs, its common.
I have been trying to build the Signed APK of an application having simple navigation drawer. I have created the keystore as followed the official react docs. But finally once oi created the bundle i am trying to run "react-native run-android --variant=release", it gives a successful build but the app crashes once i open the nav drawer swipe right. But the app works totally fine running with the development server. I even tried $ cd android && ./gradlew bundleRelease , even then the application crashes at the same point. Can even suggest me how could i fix this , will this be a setup issue ?
Try to bundle all assets but before that delete files inside directory
android/app/src/main/assets
and then run $ 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
and then try to continue with your steps.
I think title explains itself my problem, on emulator everything works as it should be, when apk builded I have transfered it on my smartphone and there's errors:
https://imgur.com/a/pSEKXHx
I was have the same issue when i assemble Release/Debug apk and install it on my physical smartPhone
Do this commands in your Project Directory :
mkdir android/app/src/main/assets
(if you have the assets folder you will see error like directory is already exist ... no problem! go to next command)
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 or assemble the apk
it should work GOOD LUCK
I have made sure that bundler and emulator are running.
If I use this commend
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
It might work but refresh won't happen when I press rr in emulator.
I have also tried reversal of abd adb reverse tcp:8081 tcp:8081.
Nothing works for me.
click here to see the error screen.
To resolve Unable to load script from assets index.android.bundle - React Native follow below process :
You have to create dir assets manually in your android project or make Directory by Terminal/CMD enter mkdir android/app/src/main/assets
Go at the created Directory if that is successfully created then
run step 3 Command:
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
you have your missed files in the folder now you can Run your React Native project npm run android.
Sometimes you have to clear the cache to load your assets properly.
Use the command react-native start --reset-cache
and re-run react-native run-android
I had this issue after having had it work for the past couple days. I realized that I had manually configured a proxy. As soon as I turned that off, it worked.
For me, Gradle clean fixed it when I was having an issue on Android
cd android
./gradlew clean