Opened 13 years ago

Closed 12 years ago

#632 closed defect/bug (fixed)

Android build fails with latest Android NDK

Reported by: mvglasow (2) Owned by: KaZeR
Priority: major Milestone:
Component: core Version: git master
Severity: Keywords:
Cc: nick@…


When building Navit for Android with the most recent NDK (downloaded a few days ago), the command

android update project -t 3 -p android

causes an error message.

Cause: The -t parameter specifies the target platform. This can either be a number (as above) or a string identifier such as "android-3".

The string refers to the API level, android-3 corresponds to Android 1.5 (Cupcake).

The numbers seem to be assigned at random, when querying with "android list targets" I get 1 as the numeric ID for android-3.

After changing the command call in navit/navit/ to a string rather than a numeric identifier, navit builds successfully.

(Limited warranty: the resulting apk crashes on start, but that also goes for each and every SVN version I have tried.)

Patch follows; this should at least cause Navit to build correctly. However, the same string also occurs in the library and include paths, so it might make sense to introduce a global variable for this and use that in every place - that way we would even make the target API level configurable. The patch however will do as long as we remain on API level 3.

Caveat: the current patch may break compatibility with older NDK versions as the wiki article indicates that older NDK versions used the Android version rather than the API level in path names (that is, android-1.5 rather than android-3). In that case an upgrade may be required.

Attachments (1)

navit_3490_ticket_632.patch (497 bytes) - added by mvglasow (2) 13 years ago.
Fix for android build with latest NDK

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by mvglasow (2)

Fix for android build with latest NDK

comment:1 Changed 13 years ago by mvglasow (2)

as for the limited warranty, I tried the apk in the emulator, where it starts up OK.

comment:2 Changed 12 years ago by mvglasow (2)

amendment: the crash on Freerunner appears to be the issue described in #576, which looks like a specific issue with Android on Freerunner. Given this and the fact that it works in the emulator, I would say it is safe to assume that this patch does not break anything other than introducing a requirement for a minimum NDK version.

comment:3 Changed 12 years ago by number6

  • Cc nick@… added
  • Resolution set to fixed
  • Status changed from new to closed

Added in Revision 3632

Note: See TracTickets for help on using tickets.