Ask Your Question
1

Modifying MainActivity.java does not result in new apk?

asked 2012-03-30 09:09:47 -0500

amigo gravatar image

updated 2012-03-30 09:24:12 -0500

I'm working on android_tutorial_pubsub. When I modify MainActivity.java, it does not seem to build a new MainActivity-debug.apk. I added log messages to MainActivity.java; Then I did the standard build command (../gradlew debug), uninstalled the old app and then installed the apk file. But the log messages weren't appearing in logcat. Then I noticed that the time stamp on the apk file wasn't changing. When I did a clean and rebuild (debug), my messages appeared in logcat. If I don't do a clean, building doesn't seem to update the apk file. Any ideas what's going on?

Thanks!

edit retag flag offensive close merge delete

Comments

How are you building your project? Eclipse? Ant? Something else?

damonkohler gravatar image damonkohler  ( 2012-04-03 22:12:35 -0500 )edit

How are you building your project? Eclipse? Ant? Something else?

damonkohler gravatar image damonkohler  ( 2012-04-03 22:12:39 -0500 )edit

I saw the same behavior. This seems to happen when building with gradle or gradlew.

jbohren gravatar image jbohren  ( 2012-04-04 06:32:05 -0500 )edit

As jbohren mentioned, I was building with gradlew at the command-line.

amigo gravatar image amigo  ( 2012-04-04 07:29:50 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2012-04-05 09:23:01 -0500

damonkohler gravatar image

I do not have a good explanation for this. However, rosjava does not modify the build.xml generated by the Android SDK. You can interact with the project using ant exactly as described here: http://developer.android.com/guide/developing/building/building-cmdline.html

I suspect this is a bug in the Android SDK: http://stackoverflow.com/questions/8634359/ant-not-rebuilding-android-application-with-ant-debug-install

However, do not downgrade as rosjava requires bug fixes in r17.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-03-30 09:09:47 -0500

Seen: 1,145 times

Last updated: Apr 05 '12