SlidingMenu integration issues

I am trying to use the SlidingMenu library in my Android Studio project following the guide provided in this question:

How do I import a sliding menu into Android Studio?

I managed to get the described file structure and sync and build the project without errors. However, when I try to import the slide menu into my application source files, I get a symbol resolution error.

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; // Error message: Cannot resolve symbol 'SlidingMenu'
import com.jeremyfeinstein.slidingmenu.lib.BuildConfig;

      

The second import is the only one suggested by Android Studio, but I can't even find the BuildConfig file in my project when it follows the specified path.

What do I need to change to be able to import all the classes in com.jeremyfeinstein.slidingmenu.lib

to my own classes?

My app gradle files look like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.me.appname"
        minSdkVersion 17
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'
    compile project(':libraries:SlidingMenu')
}

      

SlidingMenu gradle file:

buildscript {
    // define the repo which is to use
    repositories {
        mavenCentral()
    }
    // define the classpath for Gradle Android Plugin
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.+'
    }
}

// declaring that the project is a library
apply plugin: 'android-library'

// declaring all dependencies the project needs
dependencies {
    compile 'com.android.support:support-v4:19.0.0'
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        // this values you can read out from the Manifest (but I add the right values for you)
        minSdkVersion 17
        targetSdkVersion 21
    }

    // because Android Studio has a different file structure than Eclipse
    // you have to say Android Studio where the files are located
    sourceSets{
        main{
            java.srcDirs = ['src/main/java']
            res.srcDirs = ['src/main/res']

            manifest.srcFile 'AndroidManifest.xml'
        }
    }
}

      

Gradle project settings:

include ":libraries:SlidingMenu", ':app'

      

+3


source to share


1 answer


Get the AAR port of the library (v1.3).



GitHub pages don't work, so you'll have to manually import

+5


source







All Articles