Eclipse does not update apk when making changes to phonegap application

This question has been asked, but none of the answers work, for example, clean, updated, changed version numbers, etc. Eclipse does not rebuild the android project when making changes to the source files. This is a phonegap application, and if I modify html files or even Java code, I still get the same apk !! If I change the version number, this change is reflected, but not any other change. Any help would be great

+4
source share
4 answers

You do not quite understand what you are actually doing, I will try to guess (next time, please provide more detailed information if you want help).

I assume that you created the cordova 3.x project using cli, added the Android platform and then imported the platform / android project into eclipse (at this point I hope that you did not check the “copy projects into the workspace” option).

Then you modify the html / javascript files in the projectroot / www folder, and these changes are not reflected when you go into eclipse and create apk.

Sorry if my assumption is wrong, but if it is not, I think you are missing a step in the process.

Here's what you should do (if you created the project using phonegap cli and not cordova, replace cordova with phone entries in the following command):

  • make changes to the projectroot / www folder
  • run the cordova prepare android command
  • go to eclipse and update the project
  • build apk in eclipse
+4
source

You can automate the execution of the preparation and update command, so when you save the file, your Android application is automatically updated. Please note that you need to work with resources located in the www link folder in the Android application project. .

  • Click "Your eclipse project options" and go to "Builders".
  • Click "Create" to add a new Builder.
  • Select a program.
  • In the Main tab, set:
    • / usr / bin / cordova .
    • In the working directory, specify the root directory of your project.
    • prepare android in arguments
  • On the Refresh tab, activate Refresh Resources After Completion.
  • Finally, on the Build Options tab, enable the During Automated Build options to run this new Builder while saving the resource.

And that’s all, now your Android application will be constantly updated.

+3
source

Just in case, someone has my rare problem ...

I had this problem, but I realized that the timestamp of my apk was in the future. I recently set a date on my computer after generating at least 1 new apk, and a new timestamp prevented apk from updating.

+1
source

I faced the same problem

     cordova prepare
     cordova build 

the updated project didn’t work, then I deleted apk in

     platforms / android / bin / hellocordova-debug.apk

then my changes in index.html and home.html are visible on my device.

0
source

All Articles