错误:(87,8)错误:找不到符号方法addOnPageChangeListener(<anonymous simpleonpagechangelistener =“”>)

时间:2015-12-09 12:20:57

标签: java android android-viewpager

我的项目完美运行(浏览器没问题)直到我添加了2个新库...事情开始变坏,现在它返回&#34;找不到符号方法addOnPageChangeListener&#34;即使我从我的代码中删除了该方法,它也会返回&#34;非零值2&#34;。我确实理解它可能来自重复的app-support v4,但我的库或项目都没有编译android app-support v4

/Users/Hassan/Desktop/And/ListBuddies-master/example/src/main/java/com/jpardogo/android/listbuddies/PageV.java
  

错误:(87,8)错误:找不到符号方法addOnPageChangeListener()   注意:某些输入文件使用或覆盖已弃用的API。   注意:使用-Xlint重新编译:弃用以获取详细信息。   错误:任务执行失败&#39;:示例:compileDebugJavaWithJavac&#39;。    编译失败;有关详细信息,请参阅编译器错误输出。

MainProject grable

 apply plugin: 'android'
apply plugin: 'com.parse'

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.parse.com/repo'
        }

    }
    dependencies {
        classpath 'com.parse.tools:gradle:1.+'

    }
}
android {

    compileSdkVersion 23
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId "com.parse.starter"
        minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
        versionName project.VERSION_NAME
        versionCode Integer.parseInt(project.VERSION_CODE)
    }

    lintOptions {
        abortOnError Boolean.parseBoolean(project.ABORT_ON_ERROR)
    }

    signingConfigs { release }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

}

dependencies

 {
    compile fileTree(dir: 'libs', include: '*.jar')
    // compile 'libraries.android_support'
    compile 'com.squareup.picasso:picasso:2.3.3'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    // compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
    compile 'com.android.support:support-v4:23.1.0'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.1.0'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.github.bumptech.glide:glide:3.6.0'
    compile 'com.etsy.android.grid:library:1.0.5'
    compile 'com.parse.bolts:bolts-android:1.2.1'
    compile 'com.parse:parse-android:1.10.3'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.github.jorgecastilloprz:fillableloaders:1.02@aar'
    compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
    compile 'com.github.tibolte:elasticdownload:1.0.+'
    compile 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile project(':library')
    compile project(':facebook')
    //  compile project(':ListViewAnimations-core')
    //compile project(':progress')
    compile project(':SwipeTouchListenerTestActivity')
  //  compile project(':ListViewAnimations-core')
}


File propFile = file('signing.properties');
if (propFile.exists()) {
    def Properties props = new Properties()
    props.load(new FileInputStream(propFile))

    if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
            props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
        android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
        android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
        android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
        android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
    } else {
        android.buildTypes.release.signingConfig = null
    }
} else {
    android.buildTypes.release.signingConfig = null
}

FirstLibrary Gradle

apply plugin: 'android-library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':ListViewAnimations-core')
   // compile 'com.android.support:support-v4:23.1.0'
}

android {
    compileSdkVersion 21
    buildToolsVersion "20.0.0"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

第二图书馆Gradle

    apply plugin: 'android-library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
  //  compile 'com.android.support:support-v4:23.1.0'
}

android {
    compileSdkVersion 21
    buildToolsVersion "20.0.0"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

0 个答案:

没有答案