Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
186 views
in Technique[技术] by (71.8m points)

java - Package does not exist when using separate App as a dependency

I'm trying to compile an App utilising a separate App as a dependency but when I compile referencing modules from this library I see several "error:package does not exist" and "error:cannot find symbol class" messages from graddle. The following are my two build files.

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 19
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    packagingOptions {
        exclude 'AndroidManifest.xml'
        exclude 'resources.arsc'
        exclude 'classes.dex'
    }
}

dependencies {
    repositories {
        mavenCentral()
    }
    compile 'com.android.support:support-v4:+'
    compile 'com.google.code.gson:gson:2.2.2'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:+'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
    compile 'se.emilsjolander:stickylistheaders:2.+'
    compile 'com.googlecode.libphonenumber:libphonenumber:+'
    compile files('libs/crashlytics.jar')
    compile files('libs/httpclient-4.2.3.jar')
    compile files('libs/libphonenumber-5.9.jar')
    compile files('libs/mobileservices-0.2.0-javadoc.jar')
    compile files('libs/mobileservices-0.2.0.jar')
    compile files('libs/stringtotime-1.0.4.jar')
    compile files('libs/urbanairship-lib-2.0.2.jar')
    compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abs:+'
    compile files('libs/FlurryAnalytics-4.0.0.jar')
    compile 'com.squareup.picasso:picasso:2.3.3'
    compile project(':wheel')
}

Dependency gradle:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "kankan.wheel"
        minSdkVersion 5
        targetSdkVersion 7
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

}

Can anyone help/experienced this before? Android Studio does not highlight any issues in the class and I can ctrl+click through to the packages referenced which seems to mean it is set up correctly...

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The buildTypes section should not be in library build.gradle file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...