Omim: Android build problem

Created on 3 Mar 2016  Â·  42Comments  Â·  Source: mapsme/omim

Hi,
Thanks for your great job about making this nice project open source!
I'm trying import project into android studio (Windows 8.1 64-bit) and I've done this steps till now (using this tutorial that seems inefficient at least to me)
1- Install QT 5.5
2- Install VS 2013
3- Install QT addin for VS and configure
4- 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\
5- Install Cygwin and add it to Path (it works now because I can run *.sh files inside cmd.exe)
6- Run set_up_android.py and face this error :

   File "C:\omim-master\tools\android\set_up_android.py", line 53
         print 'Could not find {0}, not an {1} path.'.format(test, title)

7- 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)
8- Run 'gradlew clean assembleWebRelease' and faced this Error :

* What went wrong:
Task 'assembleWebRelease' not found in root project 'android'. Some candidates are: 'assembleRelease
', 'assembleX86Release'.

9- Run assembleRelease after doing some stuff:

What went wrong:
Execution failed for task ':cppBuildRelease'.
> Process 'command 'bash'' finished with non-zero exit value 1

Also running gradlew installRelease has errors too.
10- 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:

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'com.android.tools.build:gradle:1.3.1'
  }
}

allprojects {
  repositories {
    jcenter()
    mavenCentral()
  }
}

apply plugin: 'com.android.application'
apply from: 'secure.properties'

dependencies {
  // android support libs
  compile 'com.android.support:support-v4:22.2.1'
  compile 'com.android.support:appcompat-v7:22.2.1'
  compile 'com.android.support:recyclerview-v7:22.2.1'
  compile 'com.android.support:design:22.2.1'
  // google play services
  compile 'com.google.android.gms:play-services-location:8.4.0'
  compile 'com.google.android.gms:play-services-analytics:8.4.0'
  compile 'com.google.android.gms:play-services-plus:8.4.0'
  // 3-party
  compile 'com.facebook.android:facebook-android-sdk:4.10.0'
  compile 'com.parse.bolts:bolts-android:1.4.0'
  compile 'com.parse:parse-android:1.13.0'
  compile 'com.google.code.gson:gson:2.6.1'
  compile fileTree(dir: '3rd_party', include: '*.jar')
  // BottomSheet
  compile project(":3rd_party:BottomSheet")
  // LinearLayoutManager allowing wrap_content of RecyclerView-s
  // TODO remove this library when default LinearLayoutManager will be fixed.
  compile 'org.solovyev.android.views:linear-layout-manager:0.5@aar'
}

def getDate() {
  def date = new Date()
  def formattedDate = date.format('yyMMdd')
  return formattedDate
}

project.ext.versionCodes = ['armeabi-v7a': 1, 'x86': 2]
project.ext.appId = 'com.mapswithme.maps.pro'

android {
  // All properties are read from gradle.properties file
  compileSdkVersion propTargetSdkVersion.toInteger()
  buildToolsVersion propBuildToolsVersion

  defaultConfig {
    // Default package name is taken from the manifest and should be com.mapswithme.maps
    versionCode propVersionCode.toInteger()
    versionName propVersionName
    minSdkVersion propMinSdkVersion.toInteger()
    targetSdkVersion propTargetSdkVersion.toInteger()
    applicationId project.ext.appId
    buildConfigField 'String', 'SUPPORT_MAIL', '"[email protected]"'
    buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"'
    buildConfigField 'int', 'RATING_THRESHOLD', '5'
  }

  sourceSets.main {
    manifest.srcFile 'AndroidManifest.xml'
    res.srcDirs = ['res']
    java.srcDirs = ['src', '../3party/Alohalytics/src/android/java']
    // assets folder is auto-generated by tools/android/update_assets.sh, so we keep all static resources in separate folders.
    assets.srcDirs = ['assets']
    jniLibs.srcDirs = ['libs']
  }



  // 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.
  // TODO check that feature when new gradle plugins will appear
  // connected bugreport https://code.google.com/p/android/issues/detail?id=178606
  splits.abi {
    enable true
    reset()
    include 'x86', 'armeabi-v7a'
    universalApk true
  }

  // TODO: Fix a lot of lint errors in our code
  lintOptions {
    abortOnError false
  }

  gradle.projectsEvaluated {
    android.applicationVariants.all { variant ->
      def task = variant.name.capitalize()
      project.task(type: Exec, "run${task}", dependsOn: "install${task}") {
        commandLine android.getAdbExe(), 'shell', 'am', 'start', '-n', "${applicationId}/com.mapswithme.maps.DownloadResourcesActivity"
      }

      variant.outputs.each { output ->
        if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {
          def file = output.outputFile
          // version at the end of each built apk
          output.outputFile = new File(file.parent, file.name.replace(".apk", "-" + android.defaultConfig.versionName + "-" + getDate() + ".apk"))
          // set different versionCodes for different ABIs
          int abiVersionCode = project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI)) ?: 0
          output.versionCodeOverride = (abiVersionCode * 1000) + android.defaultConfig.versionCode
        }
      }
    }
  }

//  signingConfigs {
//    mapswithme {
//      storeFile file(spropStoreFile)
//      storePassword spropStorePassword
//      keyAlias spropKeyAlias
//      keyPassword spropKeyPassword
//    }
//
//    mapswithmeDebug {
//      storeFile file('../tools/android/debug.keystore')
//      storePassword '12345678'
//      keyAlias 'debug'
//      keyPassword '12345678'
//    }
//  }

  buildTypes {
    debug {
      applicationIdSuffix '.debug'   // Allows to install debug and release builds together
      versionNameSuffix '-debug'
      jniDebuggable true           // Enable jni debug build
      zipAlignEnabled true
//      signingConfig signingConfigs.mapswithmeDebug
      android.sourceSets.debug.setRoot('flavors/debug')
    }

    release {
//      signingConfig signingConfigs.mapswithme
      minifyEnabled true
      shrinkResources true
      proguardFile('proguard-mwm.txt')
    }

    beta {
      applicationIdSuffix '.beta'
      versionNameSuffix '-beta'
//      signingConfig signingConfigs.mapswithme
      android.sourceSets.beta.setRoot('flavors/beta')
    }
  }

  // We don't compress these extensions in assets/ because our random FileReader can't read zip-compressed files from apk
  aaptOptions {
    noCompress 'txt', 'bin', 'html', 'png', 'json', 'mwm', 'ttf', 'sdf', 'ui'
    ignoreAssetsPattern "!.svn:!.git:!.DS_Store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
  }

  // Enables new Java features in KitKat+ but needs Java 1.7 installed
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
  }
}

// Tasks needed to compile NDK part
apply plugin: 'base'

project.ext.PARAM_PARALLEL_TASK_COUNT = '-j' + (Runtime.runtime.availableProcessors() + 1)
project.ext.NDK_BUILD = android.getNdkDirectory().toString() + '/ndk-build'
if (System.properties['os.name'].toLowerCase().contains('windows'))
  project.ext.NDK_BUILD += ".cmd"

def archs = ['x86', 'armeabi-v7a-hard']
def buildTypes = [[ndkType: 'release', cppType: "production", flags : propReleaseNdkFlags], [ndkType: 'debug', cppType: "debug", flags : propDebugNdkFlags]]

buildTypes.each { type ->
  def suffix = type.ndkType.capitalize()
  createCppBuildTask(type.cppType, '', suffix)
  createNdkBuildTask(type.ndkType, '', suffix, type.flags)

  archs.each { arch ->
    suffix = type.ndkType.capitalize() + arch.capitalize()
    createCppBuildTask(type.cppType, arch, suffix)
    createNdkBuildTask(type.ndkType, arch, suffix, type.flags)
  }
}

def createCppBuildTask(buildType, arch, suffix) {
  return tasks.create(name: "cppBuild${suffix}", type: Exec, description: "Building ${buildType} version of static C++ libraries. Arch : ${arch}") {
    def args = ['bash', '../tools/autobuild/android.sh', buildType]
    if (!arch.isEmpty())
      args += arch
    commandLine args
  }
}

def createNdkBuildTask(buildType, arch, suffix, flags) {
  return tasks.create(name: "ndkBuild${suffix}", dependsOn: "cppBuild${suffix}", type: Exec, description: "Building ${buildType} version of jni. Arch : ${arch}") {
    def ndkParams = ([project.ext.NDK_BUILD, project.ext.PARAM_PARALLEL_TASK_COUNT] + flags.split(' ')).flatten()
    if (!arch.isEmpty())
      ndkParams += "NDK_ABI_TO_BUILD=${arch}"
    commandLine ndkParams
  }
}

task ndkBuildClean(type: Exec, description: 'Clean native jni libraries') {
  commandLine project.ext.NDK_BUILD, 'clean'
}

tasks.withType(JavaCompile) { compileTask ->
  if (compileTask.name.contains('Release') || compileTask.name.contains('Beta')) {
    compileTask.dependsOn ndkBuildRelease
  } else {
    compileTask.dependsOn ndkBuildDebug
  }
}

// NOTE : it does NOT clean built cpp static libs. cppClean does.
clean.dependsOn ndkBuildClean

// Cleans built native static libs.
task cppClean(type: Delete) << {
  buildTypes.each { type ->
    archs.each { arch ->
      delete "../../omim-android-${type.cppType}-${arch}"
    }
  }
}

// Tasks for generating obb files for Google Play
def unalignedFonts = "${propObbFontsOutput}.unaligned"
def unalignedWorlds = "${propObbWorldsOutput}.unaligned"

task obbClean(type: Delete) << {
  [propObbFontsOutput, propObbWorldsOutput, unalignedFonts, unalignedWorlds].each { file ->
    delete file
  }
}

task obbGenerate() {
  createObbGenerateTask('Main', propObbFonts.split(' '), unalignedFonts)
  createObbGenerateTask('Patch', propObbWorlds.split(' '), unalignedWorlds)
  createObbAlignTask('Main', unalignedFonts, propObbFontsOutput)
  createObbAlignTask('Patch', unalignedWorlds, propObbWorldsOutput)
}

obbGenerate.dependsOn obbClean, obbMainGenerate, obbPatchGenerate, obbMainAlign, obbPatchAlign

def createObbGenerateTask(type, data, name) {
  return tasks.create(name: "obb${type}Generate", type: Exec, description: 'Generate obb files') {
    commandLine ((['zip', '-0', '-j', name, data]).flatten())
  }
}

def createObbAlignTask(type, rawObb, alignedObb) {
  def sdkDir = "${android.getSdkDirectory().getAbsolutePath()}"
  def zipalignPath = sdkDir + File.separator + "build-tools" + File.separator +
                     propBuildToolsVersion + File.separator + "zipalign";

  return tasks.create(name: "obb${type}Align", dependsOn: "obb${type}Generate", type: Exec, description: 'Align obb files') {
    commandLine zipalignPath, '-v', '8', rawObb, alignedObb
  }
}

task obbPush(dependsOn: ['obbGenerate', 'obbPushMain', 'obbPushPatch']) {
  def obbPath = "/mnt/sdcard/Android/obb/${project.ext.appId}/"
  tasks.create(type: Exec, name: 'obbRemoveOnDevice') {
    commandLine android.getAdbExe(), 'shell', 'rm', "${obbPath}*.obb"
  }
  tasks.create(type: Exec, name: 'obbPushMain', dependsOn: 'obbRemoveOnDevice') {
    commandLine android.getAdbExe(), 'push', propObbWorldsOutput, "${obbPath}fonts.obb"
  }
  tasks.create(type: Exec, name: 'obbPushPatch', dependsOn: 'obbRemoveOnDevice') {
    commandLine android.getAdbExe(), 'push', propObbFontsOutput, "${obbPath}worlds.obb"
  }
}

task patchNdkR10E(type: Exec, description: 'Patches NDK r10e for bug described here https://code.google.com/p/android/issues/detail?id=179410') {
  def cxxabiPath = "${android.getNdkDirectory().getAbsolutePath()}/sources/cxx-stl/gabi++/src/cxxabi.cc"
  commandLine 'bash', '-c', "patch -p1 ${cxxabiPath} < ../tools/android/cxxabi.cc_patch"
}

11- Run the project and face this error:

Error:Execution failed for task ':cppBuildDebug'.
> Process 'command 'bash'' finished with non-zero exit value 1

Sorry for long post and thanks for your responsibility.

Most helpful comment

Have you run ./configure.sh script in the repo root? It should create all missing files.

All 42 comments

Hello, Same problem "Mastersecure.properties' as it does not exist." I attached log file
Have you get any solution ?
image

Please check instructions and run configure.sh script.

On 19.3.2016, at 05.56, iMakerkaushal [email protected] wrote:

Hello, Same problem "Mastersecure.properties' as it does not exist." I attached log file
Have you get any solution ?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

Error:(29, 0) Could not read script 'C:UsersamishaDownloadsCompressedomim-masteromim-masterandroidsecure.properties' as it does not exist.
Open File

Have you run ./configure.sh script in the repo root? It should create all missing files.

No, I directly download and import project in android studio. where and how to run ./configure.sh? i am using windows os(windows7)

./configure.sh file is situated at the root of the project. You have to install cygwin at least.

thanks trashkalmar. i am installing it. but cant it be done by windows os without simulating linux?

It can, if someone improves current script and ports it to Windows.

At this time it is not possible.

guys iam almost there just list step to go.

i installed cygwin and did following
1) ./configure.sh
in response i got "If you are developer from MAPS.ME team, please specify a private repository url here.If not [yet :)], then just press Enter."
and i pressed enter
response => "Initializing repository with default values in Open-Source mode."

2) ./gradlew
response=> "......BUILD SUCCESSFUL"

3) went to Android Studio and tried running the project. and got "Error:(1, 1) Error: Content is not allowed in prolog." error in 3 files.

@iMakerkaushal go to android/script directory and run replace_links.bat file.

Error:Execution failed for task ':ndkBuildClean'.

A problem occurred starting process 'command 'null/ndk-build.cmd''

deathbaba would you please solve the last issue i faced. there is only one error which says

Error:Execution failed for task ':ndkBuildClean'.
A problem occurred starting process 'command 'null/ndk-build.cmd''

i have enabled the "android sdk support" plugin in android studio.

More details are needed. Something is wrong with your environment

On 24.5.2016, at 07.42, iMakerkaushal [email protected] wrote:

deathbaba would you please solve the last issue i faced. there is only one error which says

Error:Execution failed for task ':ndkBuildClean'.
A problem occurred starting process 'command 'null/ndk-build.cmd''

i have enabled the "android sdk support" plugin in android studio.

—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@iMakerkaushal

Actually, we do not officially support building Android project under Windows.

Some hints to set up your environment:

  • You must use Windows x64 OS.
  • Install Cygwin.
  • Install Qt 5.5 or newer.
  • Install Visual Studio 2013 or newer. Trial is OK. It is required for link.exe only.
  • Path to Cygwin directory in the PATH variable should come first.
  • Do not use Cygwin shell nor Git shell. Just cmd.exe.
  • Set up local.properties as usual. Set sdk.dir and ndk.dir for correct Android SDK and NDK (r11c) locations.
  • Launch android/script/replace_links.bat to replace symbolic links with actual files.
  • Run cmd.exe under android dir and build with "gradlew installRelease" command.

Hope this helps. Good luck!

Now I have create this project in to ubuntu os 15.10
I ran command "./gradlew clean" using Terminal
Terminal Gives Error as Below:
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.IllegalStateException: buildToolsVersion is not specified.
at com.google.common.base.Preconditions.checkState(Preconditions.java:176)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:606)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:572)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:569)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:568)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:565)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:510)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/imaker/Documents/Android Projects/omim-master/android/build.gradle' line: 29
  • What went wrong:
    A problem occurred evaluating root project 'android'.

Could not read script '/home/imaker/Documents/Android Projects/omim-master/android/secure.properties' as it does not exist.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Did you check documentation and run ./configure.sh?

On 28.5.2016, at 06.14, iMakerkaushal [email protected] wrote:

Now I have create this project in to ubuntu os 15.10
I ran command "./gradlew clean" using Terminal
Terminal Gives Error Below:
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.IllegalStateException: buildToolsVersion is not specified.
at com.google.common.base.Preconditions.checkState(Preconditions.java:176)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:606)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:572)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:569)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:568)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:565)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:93)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:82)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:510)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

FAILURE: Build failed with an exception.

Where:
Build file '/home/imaker/Documents/Android Projects/omim-master/android/build.gradle' line: 29

What went wrong:
A problem occurred evaluating root project 'android'.

Could not read script '/home/imaker/Documents/Android Projects/omim-master/android/secure.properties' as it does not exist.

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Yes I have run ./configure.sh from terminal of ubuntu. Is there mistake by me?, I have to run from Repo, I found repo from https://source.android.com/source/using-repo.html#download , This Command "$ repo download platform/build 23823"
is right for repo download?

I want to implement project only for Android So I import this "https://github.com/mapsme/omim/tree/master/android" into Android Studio after download. Then I run command "./configure.sh" then run this command "./gradlew clean" using terminal of ubuntu

Error:(1, 1) Error: Content is not allowed in prolog.

Below 2 files gives error
../values-zh-rTW/strings.xml
../values-zh-rTW/strings.xml
Please help

@iMakerkaushal see my comment above.

I do replace_links.bat but now below error facing
Error:(264, 0) No such property: ABI for class: org.gradle.api.tasks.OutputFile
Open File

Now
Error:(424, 0) Cannot invoke method getAbsolutePath() on null object
Open File

hi
is there any tutorials for importing and using in windows for android studio?

is there any tutorials for importing and using in windows for android studio?

If there was a good tutorial, you couldn't find this thread as long as is exists now!

@iMakerkaushal did you find any solution for this Error "No such property: ABI for class: org.gradle.api.tasks.OutputFile"

@iMakerkaushal I too got the following errors when I tried to build V 5.1.8 (in Dec 2015) under Windows7:-
../values-zh-rTW/strings.xml
../values-zh-rMO/strings.xml
as they both contain:-
../values-zh-rTW/strings.xml
I simply replaced "../values-zh-rTW/strings.xml" with the contents from file:-
values-zhstrings.xml (as I wasn't concerned about translation)
It seems that running replace_links.bat doesn't cure this error.

hi i am also facing the same error. also run replace_
links.bat file but it is showing this error. Someone please help:
E:maps_meomim-masterandroid>cp ../data/categories.txt assets/
'cp' is not recognized as an internal or external command,
operable program or batch file.

@jasmeetsahni You have to install cygwin first.

@trashkalmar actually i am running this app in ubuntu 16.04
In this initially i had run ./set_up_android.py file then i had run ./gradlew clean assembleWebRelease command in command line but it is showing below written error

home/dell/maps_me/omim-master/routing/routing_session.cpp:15:10: fatal error: '3party/Alohalytics/src/alohalytics.h' file not found

include "3party/Alohalytics/src/alohalytics.h"

     ^

1 error generated.
Makefile:37830: recipe for target '../out/production/tmp/routing/routing_session.o' failed
make[1]: * [../out/production/tmp/routing/routing_session.o] Error 1
make[1]:
Waiting for unfinished jobs....
make[1]: Leaving directory '/home/dell/maps_me/omim-android-production-armeabi-v7a/routing'
Makefile:211: recipe for target 'sub-routing-make_first' failed
make: *
* [sub-routing-make_first] Error 2

  • echo 'ERROR while building armeabi-v7a config'
  • exit 1
    ERROR while building armeabi-v7a config
    :cppBuildRelease FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':cppBuildRelease'.

    Process 'command 'bash'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Can anyone please tell me what i should do now.

You did not clone all 3party submodule repositories.

On 7.7.2017, at 17.29, jasmeetsahni notifications@github.com wrote:

@trashkalmar actually i am running this app in ubuntu 16.04
In this initially i had run ./set_up_android.py file then i had run ./gradlew clean assembleWebRelease command in command line but it is showing below written error

home/dell/maps_me/omim-master/routing/routing_session.cpp:15:10: fatal error: '3party/Alohalytics/src/alohalytics.h' file not found

include "3party/Alohalytics/src/alohalytics.h"

^
1 error generated.
Makefile:37830: recipe for target '../out/production/tmp/routing/routing_session.o' failed
make[1]: * [../out/production/tmp/routing/routing_session.o] Error 1
make[1]:
Waiting for unfinished jobs....
make[1]: Leaving directory '/home/dell/maps_me/omim-android-production-armeabi-v7a/routing'
Makefile:211: recipe for target 'sub-routing-make_first' failed
make: *
* [sub-routing-make_first] Error 2

echo 'ERROR while building armeabi-v7a config'
exit 1
ERROR while building armeabi-v7a config
:cppBuildRelease FAILED
FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':cppBuildRelease'.
Process 'command 'bash'' finished with non-zero exit value 1

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED

Can anyone please tell me what i should do now.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@deathbaba actually i did cloning in two ways:
first by just downloading zip file and run these command
second way is by cloning this from inside the android studio
but in both cases when i apply these commands it is showing above mentioned errors. did i done something wrong?

@deathbaba please ignore the previous comment.
Now I have cloned all 3party repositories but now I have a problem that when I run command ./gradlew clean assembler release then everytime system get hang. What can be the problem and solution please tell me.

You probably should wait. Try to build debug instead first.

@deathbaba how could I build debug, just by adding debugable true in gradle file or I should do something else.

Try assembleDebug instead of assembleRelease.

On 8.7.2017, at 06.03, jasmeetsahni notifications@github.com wrote:

@deathbaba how could I build debug, just by adding debugable true in gradle file or I should do something else.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@deathbaba thanks it is showing build successful after using assembledebug, but after that when i run this app in android studio it is again showing same problem i.e. system gets hang. Can u tell me how i can generate .apk file after compiling it successfully

I didn't try it, but looks like compilation can take a lot of time, especially if you have a slow CPU with few cores. Try to build and wait for 20-30 minutes and check which process consumes CPU.

@deathbaba on android studio compilation of this app is not working but leave it, now i want to ask that after compiling it in terminal i got .apk file from omim/android/build/outputs folder. initially when i was running that file in my phone it was running smoothly but after 3-4 times trial the app continously get crashing . now what can i do.
the files which i get from outputs folder are:
android-web-armeabi-v7a-debug-7.3.7-170710.apk
android-web-universal-debug-7.3.7-170710.apk
android-web-x86-debug-7.3.7-170710.apk

jasmeetsahni can you tell me how to generate apk file using terminal

Hi Guys,

I've just created a wiki page about building the android project. Please take a look at https://github.com/mapsme/omim/wiki/%5BAndroid%5D-How-to-build-project . And let me know if you have any questions and problems.

@sahir Don't forget to add this:

import com.android.build.OutputFile

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ktatar156 picture ktatar156  Â·  6Comments

Tobey16 picture Tobey16  Â·  5Comments

nighto picture nighto  Â·  7Comments

rriemann picture rriemann  Â·  4Comments

fegul picture fegul  Â·  8Comments