{"action":"created","issue":{"url":"https://api.github.com/repos/mapsme/omim/issues/2084","repository_url":"https://api.github.com/repos/mapsme/omim","labels_url":"https://api.github.com/repos/mapsme/omim/issues/2084/labels{/name}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/2084/comments","events_url":"https://api.github.com/repos/mapsme/omim/issues/2084/events","html_url":"https://github.com/mapsme/omim/issues/2084","id":138128381,"number":2084,"title":"Android build problem","user":{"login":"AlirezaAkbarix","id":15062651,"avatar_url":"https://avatars.githubusercontent.com/u/15062651?v=3","gravatar_id":"","url":"https://api.github.com/users/AlirezaAkbarix","html_url":"https://github.com/AlirezaAkbarix","followers_url":"https://api.github.com/users/AlirezaAkbarix/followers","following_url":"https://api.github.com/users/AlirezaAkbarix/following{/other_user}","gists_url":"https://api.github.com/users/AlirezaAkbarix/gists{/gist_id}","starred_url":"https://api.github.com/users/AlirezaAkbarix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlirezaAkbarix/subscriptions","organizations_url":"https://api.github.com/users/AlirezaAkbarix/orgs","repos_url":"https://api.github.com/users/AlirezaAkbarix/repos","events_url":"https://api.github.com/users/AlirezaAkbarix/events{/privacy}","received_events_url":"https://api.github.com/users/AlirezaAkbarix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-03T09:43:16Z","updated_at":"2016-05-23T07:13:53Z","closed_at":null,"body":"Hi,\r\nThanks for your great job about making this nice project open source!\r\nI'm trying import project into android studio (Windows 8.1 64-bit) and I've done this steps till now (using [this](https://github.com/mapsme/omim/blob/master/docs/INSTALL.md#android) tutorial that seems inefficient at least to me)\r\n1- Install QT 5.5\r\n2- Install VS 2013\r\n3- Install QT addin for VS and configure\r\n4- add this part to PATH for qmake.exe `E:\\Qt\\Qt5.5.1\\5.5\\msvc2013_64\\bin\\` and this part for clang `C:\\Program Files\\LLVM\\bin\\`\r\n5- Install Cygwin and add it to Path (it works now because I can run `*.sh` files inside `cmd.exe`)\r\n6- Run `set_up_android.py` and face this error : \r\n```\r\n   File \"C:\\omim-master\\tools\\android\\set_up_android.py\", line 53\r\n         print 'Could not find {0}, not an {1} path.'.format(test, title)\r\n```\r\n7- Copy a `local.properties` to root of android dir (that mentioned SDK and NDK-r10e I've downloaded before and located on a non-spaced direction)\r\n8- Run 'gradlew clean assembleWebRelease' and faced this Error : \r\n```\r\n* What went wrong:\r\nTask 'assembleWebRelease' not found in root project 'android'. Some candidates are: 'assembleRelease\r\n', 'assembleX86Release'.\r\n```\r\n\r\n9- Run `assembleRelease` after doing some stuff:\r\n```\r\nWhat went wrong:\r\nExecution failed for task ':cppBuildRelease'.\r\n> Process 'command 'bash'' finished with non-zero exit value 1\r\n```\r\n\r\nAlso running `gradlew installRelease` has errors too.\r\n10- Importing `.../omom-master/android` to android studio and sync gradle has multiple errors that commenting 'productFlavors' section removed some errors and commenting continued till sync gradle has no error, this is my last `build.gradle`:\r\n```\r\nbuildscript {\r\n  repositories {\r\n    jcenter()\r\n  }\r\n\r\n  dependencies {\r\n    classpath 'com.android.tools.build:gradle:1.3.1'\r\n  }\r\n}\r\n\r\nallprojects {\r\n  repositories {\r\n    jcenter()\r\n    mavenCentral()\r\n  }\r\n}\r\n\r\napply plugin: 'com.android.application'\r\napply from: 'secure.properties'\r\n\r\ndependencies {\r\n  // android support libs\r\n  compile 'com.android.support:support-v4:22.2.1'\r\n  compile 'com.android.support:appcompat-v7:22.2.1'\r\n  compile 'com.android.support:recyclerview-v7:22.2.1'\r\n  compile 'com.android.support:design:22.2.1'\r\n  // google play services\r\n  compile 'com.google.android.gms:play-services-location:8.4.0'\r\n  compile 'com.google.android.gms:play-services-analytics:8.4.0'\r\n  compile 'com.google.android.gms:play-services-plus:8.4.0'\r\n  // 3-party\r\n  compile 'com.facebook.android:facebook-android-sdk:4.10.0'\r\n  compile 'com.parse.bolts:bolts-android:1.4.0'\r\n  compile 'com.parse:parse-android:1.13.0'\r\n  compile 'com.google.code.gson:gson:2.6.1'\r\n  compile fileTree(dir: '3rd_party', include: '*.jar')\r\n  // BottomSheet\r\n  compile project(\":3rd_party:BottomSheet\")\r\n  // LinearLayoutManager allowing wrap_content of RecyclerView-s\r\n  // TODO remove this library when default LinearLayoutManager will be fixed.\r\n  compile 'org.solovyev.android.views:linear-layout-manager:0.5@aar'\r\n}\r\n\r\ndef getDate() {\r\n  def date = new Date()\r\n  def formattedDate = date.format('yyMMdd')\r\n  return formattedDate\r\n}\r\n\r\nproject.ext.versionCodes = ['armeabi-v7a': 1, 'x86': 2]\r\nproject.ext.appId = 'com.mapswithme.maps.pro'\r\n\r\nandroid {\r\n  // All properties are read from gradle.properties file\r\n  compileSdkVersion propTargetSdkVersion.toInteger()\r\n  buildToolsVersion propBuildToolsVersion\r\n\r\n  defaultConfig {\r\n    // Default package name is taken from the manifest and should be com.mapswithme.maps\r\n    versionCode propVersionCode.toInteger()\r\n    versionName propVersionName\r\n    minSdkVersion propMinSdkVersion.toInteger()\r\n    targetSdkVersion propTargetSdkVersion.toInteger()\r\n    applicationId project.ext.appId\r\n    buildConfigField 'String', 'SUPPORT_MAIL', '\"android@maps.me\"'\r\n    buildConfigField 'String', 'REVIEW_URL', '\"market://details?id=com.mapswithme.maps.pro\"'\r\n    buildConfigField 'int', 'RATING_THRESHOLD', '5'\r\n  }\r\n\r\n  sourceSets.main {\r\n    manifest.srcFile 'AndroidManifest.xml'\r\n    res.srcDirs = ['res']\r\n    java.srcDirs = ['src', '../3party/Alohalytics/src/android/java']\r\n    // assets folder is auto-generated by tools/android/update_assets.sh, so we keep all static resources in separate folders.\r\n    assets.srcDirs = ['assets']\r\n    jniLibs.srcDirs = ['libs']\r\n  }\r\n\r\n  \r\n\r\n  // Currently (as of 1.2.3 gradle plugin) ABI filters aren't supported inside of product flavors, so we cannot generate splitted builds only for Google build.\r\n  // TODO check that feature when new gradle plugins will appear\r\n  // connected bugreport https://code.google.com/p/android/issues/detail?id=178606\r\n  splits.abi {\r\n    enable true\r\n    reset()\r\n    include 'x86', 'armeabi-v7a'\r\n    universalApk true\r\n  }\r\n\r\n  // TODO: Fix a lot of lint errors in our code\r\n  lintOptions {\r\n    abortOnError false\r\n  }\r\n\r\n  gradle.projectsEvaluated {\r\n    android.applicationVariants.all { variant ->\r\n      def task = variant.name.capitalize()\r\n      project.task(type: Exec, \"run${task}\", dependsOn: \"install${task}\") {\r\n        commandLine android.getAdbExe(), 'shell', 'am', 'start', '-n', \"${applicationId}/com.mapswithme.maps.DownloadResourcesActivity\"\r\n      }\r\n\r\n      variant.outputs.each { output ->\r\n        if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {\r\n          def file = output.outputFile\r\n          // version at the end of each built apk\r\n          output.outputFile = new File(file.parent, file.name.replace(\".apk\", \"-\" + android.defaultConfig.versionName + \"-\" + getDate() + \".apk\"))\r\n          // set different versionCodes for different ABIs\r\n          int abiVersionCode = project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI)) ?: 0\r\n          output.versionCodeOverride = (abiVersionCode * 1000) + android.defaultConfig.versionCode\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n//  signingConfigs {\r\n//    mapswithme {\r\n//      storeFile file(spropStoreFile)\r\n//      storePassword spropStorePassword\r\n//      keyAlias spropKeyAlias\r\n//      keyPassword spropKeyPassword\r\n//    }\r\n//\r\n//    mapswithmeDebug {\r\n//      storeFile file('../tools/android/debug.keystore')\r\n//      storePassword '12345678'\r\n//      keyAlias 'debug'\r\n//      keyPassword '12345678'\r\n//    }\r\n//  }\r\n\r\n  buildTypes {\r\n    debug {\r\n      applicationIdSuffix '.debug'   // Allows to install debug and release builds together\r\n      versionNameSuffix '-debug'\r\n      jniDebuggable true           // Enable jni debug build\r\n      zipAlignEnabled true\r\n//      signingConfig signingConfigs.mapswithmeDebug\r\n      android.sourceSets.debug.setRoot('flavors/debug')\r\n    }\r\n\r\n    release {\r\n//      signingConfig signingConfigs.mapswithme\r\n      minifyEnabled true\r\n      shrinkResources true\r\n      proguardFile('proguard-mwm.txt')\r\n    }\r\n\r\n    beta {\r\n      applicationIdSuffix '.beta'\r\n      versionNameSuffix '-beta'\r\n//      signingConfig signingConfigs.mapswithme\r\n      android.sourceSets.beta.setRoot('flavors/beta')\r\n    }\r\n  }\r\n\r\n  // We don't compress these extensions in assets/ because our random FileReader can't read zip-compressed files from apk\r\n  aaptOptions {\r\n    noCompress 'txt', 'bin', 'html', 'png', 'json', 'mwm', 'ttf', 'sdf', 'ui'\r\n    ignoreAssetsPattern \"!.svn:!.git:!.DS_Store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~\"\r\n  }\r\n\r\n  // Enables new Java features in KitKat+ but needs Java 1.7 installed\r\n  compileOptions {\r\n    sourceCompatibility JavaVersion.VERSION_1_7\r\n    targetCompatibility JavaVersion.VERSION_1_7\r\n  }\r\n}\r\n\r\n// Tasks needed to compile NDK part\r\napply plugin: 'base'\r\n\r\nproject.ext.PARAM_PARALLEL_TASK_COUNT = '-j' + (Runtime.runtime.availableProcessors() + 1)\r\nproject.ext.NDK_BUILD = android.getNdkDirectory().toString() + '/ndk-build'\r\nif (System.properties['os.name'].toLowerCase().contains('windows'))\r\n  project.ext.NDK_BUILD += \".cmd\"\r\n\r\ndef archs = ['x86', 'armeabi-v7a-hard']\r\ndef buildTypes = [[ndkType: 'release', cppType: \"production\", flags : propReleaseNdkFlags], [ndkType: 'debug', cppType: \"debug\", flags : propDebugNdkFlags]]\r\n\r\nbuildTypes.each { type ->\r\n  def suffix = type.ndkType.capitalize()\r\n  createCppBuildTask(type.cppType, '', suffix)\r\n  createNdkBuildTask(type.ndkType, '', suffix, type.flags)\r\n\r\n  archs.each { arch ->\r\n    suffix = type.ndkType.capitalize() + arch.capitalize()\r\n    createCppBuildTask(type.cppType, arch, suffix)\r\n    createNdkBuildTask(type.ndkType, arch, suffix, type.flags)\r\n  }\r\n}\r\n\r\ndef createCppBuildTask(buildType, arch, suffix) {\r\n  return tasks.create(name: \"cppBuild${suffix}\", type: Exec, description: \"Building ${buildType} version of static C++ libraries. Arch : ${arch}\") {\r\n    def args = ['bash', '../tools/autobuild/android.sh', buildType]\r\n    if (!arch.isEmpty())\r\n      args += arch\r\n    commandLine args\r\n  }\r\n}\r\n\r\ndef createNdkBuildTask(buildType, arch, suffix, flags) {\r\n  return tasks.create(name: \"ndkBuild${suffix}\", dependsOn: \"cppBuild${suffix}\", type: Exec, description: \"Building ${buildType} version of jni. Arch : ${arch}\") {\r\n    def ndkParams = ([project.ext.NDK_BUILD, project.ext.PARAM_PARALLEL_TASK_COUNT] + flags.split(' ')).flatten()\r\n    if (!arch.isEmpty())\r\n      ndkParams += \"NDK_ABI_TO_BUILD=${arch}\"\r\n    commandLine ndkParams\r\n  }\r\n}\r\n\r\ntask ndkBuildClean(type: Exec, description: 'Clean native jni libraries') {\r\n  commandLine project.ext.NDK_BUILD, 'clean'\r\n}\r\n\r\ntasks.withType(JavaCompile) { compileTask ->\r\n  if (compileTask.name.contains('Release') || compileTask.name.contains('Beta')) {\r\n    compileTask.dependsOn ndkBuildRelease\r\n  } else {\r\n    compileTask.dependsOn ndkBuildDebug\r\n  }\r\n}\r\n\r\n// NOTE : it does NOT clean built cpp static libs. cppClean does.\r\nclean.dependsOn ndkBuildClean\r\n\r\n// Cleans built native static libs.\r\ntask cppClean(type: Delete) << {\r\n  buildTypes.each { type ->\r\n    archs.each { arch ->\r\n      delete \"../../omim-android-${type.cppType}-${arch}\"\r\n    }\r\n  }\r\n}\r\n\r\n// Tasks for generating obb files for Google Play\r\ndef unalignedFonts = \"${propObbFontsOutput}.unaligned\"\r\ndef unalignedWorlds = \"${propObbWorldsOutput}.unaligned\"\r\n\r\ntask obbClean(type: Delete) << {\r\n  [propObbFontsOutput, propObbWorldsOutput, unalignedFonts, unalignedWorlds].each { file ->\r\n    delete file\r\n  }\r\n}\r\n\r\ntask obbGenerate() {\r\n  createObbGenerateTask('Main', propObbFonts.split(' '), unalignedFonts)\r\n  createObbGenerateTask('Patch', propObbWorlds.split(' '), unalignedWorlds)\r\n  createObbAlignTask('Main', unalignedFonts, propObbFontsOutput)\r\n  createObbAlignTask('Patch', unalignedWorlds, propObbWorldsOutput)\r\n}\r\n\r\nobbGenerate.dependsOn obbClean, obbMainGenerate, obbPatchGenerate, obbMainAlign, obbPatchAlign\r\n\r\ndef createObbGenerateTask(type, data, name) {\r\n  return tasks.create(name: \"obb${type}Generate\", type: Exec, description: 'Generate obb files') {\r\n    commandLine ((['zip', '-0', '-j', name, data]).flatten())\r\n  }\r\n}\r\n\r\ndef createObbAlignTask(type, rawObb, alignedObb) {\r\n  def sdkDir = \"${android.getSdkDirectory().getAbsolutePath()}\"\r\n  def zipalignPath = sdkDir + File.separator + \"build-tools\" + File.separator +\r\n                     propBuildToolsVersion + File.separator + \"zipalign\";\r\n\r\n  return tasks.create(name: \"obb${type}Align\", dependsOn: \"obb${type}Generate\", type: Exec, description: 'Align obb files') {\r\n    commandLine zipalignPath, '-v', '8', rawObb, alignedObb\r\n  }\r\n}\r\n\r\ntask obbPush(dependsOn: ['obbGenerate', 'obbPushMain', 'obbPushPatch']) {\r\n  def obbPath = \"/mnt/sdcard/Android/obb/${project.ext.appId}/\"\r\n  tasks.create(type: Exec, name: 'obbRemoveOnDevice') {\r\n    commandLine android.getAdbExe(), 'shell', 'rm', \"${obbPath}*.obb\"\r\n  }\r\n  tasks.create(type: Exec, name: 'obbPushMain', dependsOn: 'obbRemoveOnDevice') {\r\n    commandLine android.getAdbExe(), 'push', propObbWorldsOutput, \"${obbPath}fonts.obb\"\r\n  }\r\n  tasks.create(type: Exec, name: 'obbPushPatch', dependsOn: 'obbRemoveOnDevice') {\r\n    commandLine android.getAdbExe(), 'push', propObbFontsOutput, \"${obbPath}worlds.obb\"\r\n  }\r\n}\r\n\r\ntask patchNdkR10E(type: Exec, description: 'Patches NDK r10e for bug described here https://code.google.com/p/android/issues/detail?id=179410') {\r\n  def cxxabiPath = \"${android.getNdkDirectory().getAbsolutePath()}/sources/cxx-stl/gabi++/src/cxxabi.cc\"\r\n  commandLine 'bash', '-c', \"patch -p1 ${cxxabiPath} < ../tools/android/cxxabi.cc_patch\"\r\n}\r\n```\r\n\r\n11- Run the project and face this error:\r\n```\r\nError:Execution failed for task ':cppBuildDebug'.\r\n> Process 'command 'bash'' finished with non-zero exit value 1\r\n```\r\n\r\nSorry for long post and thanks for your responsibility."},"comment":{"url":"https://api.github.com/repos/mapsme/omim/issues/comments/220903591","html_url":"https://github.com/mapsme/omim/issues/2084#issuecomment-220903591","issue_url":"https://api.github.com/repos/mapsme/omim/issues/2084","id":220903591,"user":{"login":"deathbaba","id":170263,"avatar_url":"https://avatars.githubusercontent.com/u/170263?v=3","gravatar_id":"","url":"https://api.github.com/users/deathbaba","html_url":"https://github.com/deathbaba","followers_url":"https://api.github.com/users/deathbaba/followers","following_url":"https://api.github.com/users/deathbaba/following{/other_user}","gists_url":"https://api.github.com/users/deathbaba/gists{/gist_id}","starred_url":"https://api.github.com/users/deathbaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathbaba/subscriptions","organizations_url":"https://api.github.com/users/deathbaba/orgs","repos_url":"https://api.github.com/users/deathbaba/repos","events_url":"https://api.github.com/users/deathbaba/events{/privacy}","received_events_url":"https://api.github.com/users/deathbaba/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T07:13:53Z","updated_at":"2016-05-23T07:13:53Z","body":"It can, if someone improves current script and ports it to Windows."}}
{"actor":{"display_login":"deathbaba"}}