0

This is a follow up question to this question:

Error:Cause: buildToolsVersion is not specified

I just imported a project from Eclipse to AS. It had another project which was a library project and the main project used it as a library. At first, AS imported that library project as a Java project and put "apply plugin 'java'" which I believe was a cause of other issues which made the compiler not recognize symbols like com.android.Toast. I changed the plugin to apply plugin: 'com.android.library' and now I get

buildToolsVersion is not specified

My outer project's gradle.build:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

And the module's build.gradle:

apply plugin: 'com.android.library'

dependencies {
    compile 'com.google.code.gson:gson:2.6.2'
    compile files('libs/commons-lang3-3.4.jar')
    compile files('libs/linphone.jar')
    compile '__local_jars__:C:\\Users\\me\\Android Studio Projects\\MyProj\\tigris\\libs\\firebase-client-android-2.5.0.jar:unspecified'
    compile '__local_jars__:C:\\Users\\me\\Android Studio Projects\\MyProj\\tigris\\libs\\firebase-client-android-2.5.0.jar:unspecified'
}

Why is it happening?

Community
  • 1
  • 1
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
  • First you need to copy firebase-client-android-2.5.0.jar from respective mentioned path and put into library project libs folder after correct line load that jar from libs folder also you need to add this library name into settings.gradle – Haresh Chhelana Nov 07 '16 at 13:00

1 Answers1

3

Add something like this in the app-level gradle:

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"

defaultConfig {
    applicationId "YOUR_ID"
    minSdkVersion 17
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"

    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
Ognian Gloushkov
  • 2,669
  • 1
  • 20
  • 35
  • When you say "app-level gradle" you mean in the gradle of the module which is the library project? – CodeMonkey Nov 07 '16 at 13:15
  • @YonatanNir Yes – Ognian Gloushkov Nov 07 '16 at 13:16
  • Maybe I'm missing something.. In eclipse it was defined as a library project and it got some Android methods it uses (the project), however this project doesn't have a manifest file.. does it still mean the project should work with the com.android.library plugin or the java plugin? – CodeMonkey Nov 07 '16 at 13:19
  • I'm assuming something more than this error went wrong when you migrated from eclipse. Have you tried using the default migration settings ? – Ognian Gloushkov Nov 07 '16 at 13:20
  • Yeah according to the official guide – CodeMonkey Nov 07 '16 at 13:21
  • So the question is what plugin should be applied.. For now with the Java plugin I get an error with the Unresolved Context symbol and I don't have a manifest for the other project so no package name... – CodeMonkey Nov 07 '16 at 13:39