經過我整理和簡化之後, 照以下步驟就可以編譯出apk了:
You can check out OsmAnd in AndroidStudio with step-by-step :
1. Check out project from Version Control
In Android Studio's "Welcome to Android Studio" page, select "Check out project from Version Control" .
2. 我是從自己fork出來的github上做clone, 改回官方的github當然也可以.
接著花點時間clone
In "Clone Repository" page, clone from github's OsmAnd : https://github.com/osmandapp/Osmand
3. clone完, gradle的部分照預設值就好不用動
In "Import Project from Gradle" page, select "Use default gradle wrapper (recommended) "
4. 可以看到clone這麼多project回來
After import project, in "Project Window" should have 11 projects clone from github.
5. 接著要去OsmAnd-resources下載resources, 記得目錄要更名為 "resources" 並且跟Osmand放在同一層目錄
Download OsmAnd-resources, and rename directory to "resources", place with OsmAnd Project directory.
6. 如果要在x86架構的Genymotion下執行, 要改一下Build Variant
Open Build Variant window: Build->Select Builder Variant
7. 原本是預設在Armv5下, 要改成X86才可以在Genymotion上面運作
Set OsmAnd module's Build Variant with x86 or Fat. (Fat means include all cpu's library)
8.最後按下Run就可以在Genymotion上執行了.
Run and execute on Genymotion. (or your android mobile phone)