문제

I'm developing a library in c++ using the android NDK. Actually i created my project in android with both java and c++ sources. I can compile and run my project and all works fine.

Now i would like to force eclipse to reinstall the apk on the phone even if the java code is unchanged but something changed on the c++ side. Infact if i just change my c++ code and i launch the application the new library is not uploaded on the phone.

Do you know how i could achieve the result?

Thanks a lot!

도움이 되었습니까?

해결책

I have encountered this problem too.

To solve this, you could touch a random java file in your project each time you compile the NDK project (easiest is to add it to the NDK makefile).
This way Eclipse is "fooled" into re-creating the APK.

Open the Eclipse Workspace containing your project and then enable Window | Preferences | General | Workspace | Refresh automatically. Otherwise, you may need to refresh the Workspace manually (F5) before Eclipse will detect the changed file(s) and rebuild the APK.

다른 팁

Rather than touching a source file, I prefer deleting the apk file. With the "Refresh Automaticaly" option enabled, I found that it immediatly rebuilds the apk.

So I added that to my build. Here's my build alias:

alias b='ndk-build; rm -v ./bin/*.apk'

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top