gradlew assembleDebug generates no changes
Asked Answered
S

2

7

Problem

I have just finished making a few changes in my React Native app and on the android emulator when reloading ( R, R) then changes appear.

I then ran the command:

./gradlew assembleDebug

to generate a debug apk.

When I run it on the phone then changes aren't there, it still is an old version.


I have tried:

  1. Deleting the apk in:

    ./app/build/outputs/apk
    
  2. Deleting the whole:

    ./app/build directory

  3. Tried the command:

    ./gradlew cleanBuildCache
    
  4. Rebooting after cleaning the cache (3) and deleting the build directory (2)

  5. Tried the command:

    gradlew clean
    

However I still get an old version of the apk generated each time.

Seymour answered 17/11, 2017 at 9:39 Comment(0)
C
3

I think you must generate the bundle manually since you run the app on your real device.

Unable to load script from assets index.android.bundle on windows

Canales answered 17/11, 2017 at 9:57 Comment(6)
It says command not found so i did ./gradlew clean will check apkSeymour
Yeah, it should do the sameCanales
Still no changesSeymour
I think you must generate the bundle manually since you run the app on your real device right? Try check here #44447023Canales
worked perfect thanks a lot could you edit your ansxer so I can accept it?Seymour
You're welcome glad it helps you. Ok I'll edit my answerCanales
P
1
  1. Go to your project directory and check if this folder exists android/app/src/main/assets

If it exists then delete two files viz index.android.bundle and index.android.bundle.meta If the folder assets don't exist then create the assets directory there.

  1. From your root project directory do

    cd android && ./gradlew clean

  2. Finally, navigate back to the root directory and check if there is one single entry file calledindex.js

If there is only one file i.e. index.js then run following 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

If there are two files i.e index.android.js and index.ios.js then run this 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

  1. Now run react-native run-android
Playwright answered 10/9, 2021 at 4:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.