gpt4 book ai didi

android - Gradle构建因编译时错误而失败,而Android Studio IDE未显示此类错误

转载 作者:行者123 更新时间:2023-12-03 05:15:05 25 4
gpt4 key购买 nike

Gradle构建因编译时错误而失败,而Android Studio IDE没有报告此类错误。它通常与支持库类一起发生。似乎gradle无法找到现有的类,因此它抛出了error: cannot find symbol

C:\Users\Binoy\AndroidstudioProjects\DrakPlayer>gradlew.bat assembleDebug        
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:licensesdialoglibrary:compileLint
:licensesdialoglibrary:copyReleaseLint UP-TO-DATE
:licensesdialoglibrary:mergeReleaseProguardFiles UP-TO-DATE
:licensesdialoglibrary:preBuild UP-TO-DATE
:licensesdialoglibrary:preReleaseBuild UP-TO-DATE
:licensesdialoglibrary:checkReleaseManifest
:licensesdialoglibrary:prepareReleaseDependencies
:licensesdialoglibrary:compileReleaseAidl UP-TO-DATE
:licensesdialoglibrary:compileReleaseRenderscript UP-TO-DATE
:licensesdialoglibrary:generateReleaseBuildConfig UP-TO-DATE
:licensesdialoglibrary:generateReleaseAssets UP-TO-DATE
:licensesdialoglibrary:mergeReleaseAssets UP-TO-DATE
:licensesdialoglibrary:generateReleaseResValues UP-TO-DATE
:licensesdialoglibrary:generateReleaseResources UP-TO-DATE
:licensesdialoglibrary:packageReleaseResources UP-TO-DATE
:licensesdialoglibrary:processReleaseManifest UP-TO-DATE
:licensesdialoglibrary:processReleaseResources UP-TO-DATE
:licensesdialoglibrary:generateReleaseSources UP-TO-DATE
:licensesdialoglibrary:processReleaseJavaRes UP-TO-DATE
:licensesdialoglibrary:compileReleaseJavaWithJavac UP-TO-DATE
:licensesdialoglibrary:packageReleaseJar UP-TO-DATE
:licensesdialoglibrary:compileReleaseNdk UP-TO-DATE
:licensesdialoglibrary:packageReleaseJniLibs UP-TO-DATE
:licensesdialoglibrary:packageReleaseLocalJar UP-TO-DATE
:licensesdialoglibrary:packageReleaseRenderscript UP-TO-DATE
:licensesdialoglibrary:bundleRelease UP-TO-DATE
:quickscroll:compileLint
:quickscroll:copyReleaseLint UP-TO-DATE
:quickscroll:mergeReleaseProguardFiles UP-TO-DATE
:quickscroll:preBuild UP-TO-DATE
:quickscroll:preReleaseBuild UP-TO-DATE
:quickscroll:checkReleaseManifest
:quickscroll:prepareReleaseDependencies
:quickscroll:compileReleaseAidl UP-TO-DATE
:quickscroll:compileReleaseRenderscript UP-TO-DATE
:quickscroll:generateReleaseBuildConfig UP-TO-DATE
:quickscroll:generateReleaseAssets UP-TO-DATE
:quickscroll:mergeReleaseAssets UP-TO-DATE
:quickscroll:generateReleaseResValues UP-TO-DATE
:quickscroll:generateReleaseResources UP-TO-DATE
:quickscroll:packageReleaseResources UP-TO-DATE
:quickscroll:processReleaseManifest UP-TO-DATE
:quickscroll:processReleaseResources UP-TO-DATE
:quickscroll:generateReleaseSources UP-TO-DATE
:quickscroll:processReleaseJavaRes UP-TO-DATE
:quickscroll:compileReleaseJavaWithJavac UP-TO-DATE
:quickscroll:packageReleaseJar UP-TO-DATE
:quickscroll:compileReleaseNdk UP-TO-DATE
:quickscroll:packageReleaseJniLibs UP-TO-DATE
:quickscroll:packageReleaseLocalJar UP-TO-DATE
:quickscroll:packageReleaseRenderscript UP-TO-DATE
:quickscroll:bundleRelease UP-TO-DATE
:velocityviewpagerlibrary:compileLint
:velocityviewpagerlibrary:copyReleaseLint UP-TO-DATE
:velocityviewpagerlibrary:preBuild UP-TO-DATE
:velocityviewpagerlibrary:preReleaseBuild UP-TO-DATE
:velocityviewpagerlibrary:checkReleaseManifest
:velocityviewpagerlibrary:preDebugAndroidTestBuild UP-TO-DATE
:velocityviewpagerlibrary:preDebugBuild UP-TO-DATE
:velocityviewpagerlibrary:preDebugUnitTestBuild UP-TO-DATE
:velocityviewpagerlibrary:preReleaseUnitTestBuild UP-TO-DATE
:velocityviewpagerlibrary:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:velocityviewpagerlibrary:prepareReleaseDependencies
:velocityviewpagerlibrary:compileReleaseAidl UP-TO-DATE
:velocityviewpagerlibrary:compileReleaseRenderscript UP-TO-DATE
:velocityviewpagerlibrary:generateReleaseBuildConfig UP-TO-DATE
:velocityviewpagerlibrary:generateReleaseAssets UP-TO-DATE
:velocityviewpagerlibrary:mergeReleaseAssets UP-TO-DATE
:velocityviewpagerlibrary:generateReleaseResValues UP-TO-DATE
:velocityviewpagerlibrary:generateReleaseResources UP-TO-DATE
:velocityviewpagerlibrary:mergeReleaseResources UP-TO-DATE
:velocityviewpagerlibrary:processReleaseManifest UP-TO-DATE
:velocityviewpagerlibrary:processReleaseResources UP-TO-DATE
:velocityviewpagerlibrary:generateReleaseSources UP-TO-DATE
:velocityviewpagerlibrary:processReleaseJavaRes UP-TO-DATE
:velocityviewpagerlibrary:compileReleaseJavaWithJavac UP-TO-DATE
:velocityviewpagerlibrary:extractReleaseAnnotations UP-TO-DATE
:velocityviewpagerlibrary:mergeReleaseProguardFiles UP-TO-DATE
:velocityviewpagerlibrary:packageReleaseJar UP-TO-DATE
:velocityviewpagerlibrary:compileReleaseNdk UP-TO-DATE
:velocityviewpagerlibrary:packageReleaseJniLibs UP-TO-DATE
:velocityviewpagerlibrary:packageReleaseLocalJar UP-TO-DATE
:velocityviewpagerlibrary:packageReleaseRenderscript UP-TO-DATE
:velocityviewpagerlibrary:packageReleaseResources UP-TO-DATE
:velocityviewpagerlibrary:bundleRelease UP-TO-DATE
:app:prepareAsiaIvityAndroidDragSortListview10Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132310Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:app:prepareComGithubJakeWhartonViewPagerIndicator241Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE
:app:prepareComNhaarmanListviewanimationsLibCore310Library UP-TO-DATE
:app:prepareComNhaarmanListviewanimationsLibManipulation310Library UP-TO-DATE
:app:prepareComPkmmteViewCircularimageview11Library UP-TO-DATE
:app:prepareDrakPlayerLicensesdialoglibraryUnspecifiedLibrary UP-TO-DATE
:app:prepareDrakPlayerQuickscrollUnspecifiedLibrary UP-TO-DATE
:app:prepareDrakPlayerVelocityviewpagerlibraryUnspecifiedLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Transformers\DepthPageTransformer.java:21: error: cannot find symbol
public class DepthPageTransformer implements ViewPager.PageTransformer {
^
symbol: class PageTransformer
location: class ViewPager
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\AudioPlaybackService.java:868: error: cannot find symbol
Notification notification = mNotificationBuilder.build();
^
symbol: method build()
location: variable mNotificationBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\AudioPlaybackService.java:967: error: cannot find symbol
Notification notification = mNotificationBuilder.build();
^
symbol: method build()
location: variable mNotificationBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncAutoGetAlbumArtTask.java:497: error: cannot find symbol
AutoFetchAlbumArtService.builder.setProgress(dataURIsList.size(), currentProgress, false);
^
symbol: method setProgress(int,int,boolean)
location: variable builder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncAutoGetAlbumArtTask.java:498: error: cannot find symbol
AutoFetchAlbumArtService.notification = AutoFetchAlbumArtService.builder.build();
^
symbol: method build()
location: variable builder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncAutoGetAlbumArtTask.java:521: error: cannot find symbol
AutoFetchAlbumArtService.builder.setProgress(0, 0, false);
^
symbol: method setProgress(int,int,boolean)
location: variable builder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncAutoGetAlbumArtTask.java:522: error: cannot find symbol
AutoFetchAlbumArtService.notification = AutoFetchAlbumArtService.builder.build();
^
symbol: method build()
location: variable builder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\BuildMusicLibraryService.java:54: error: cannot find symbol
mBuilder.setProgress(0, 0, true);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\BuildMusicLibraryService.java:57: error: cannot find symbol
mNotification = mBuilder.build();
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\BuildMusicLibraryService.java:90: error: cannot find symbol
mBuilder.setProgress(maxProgress, overallProgress, false);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\BuildMusicLibraryService.java:93: error: cannot find symbol
mNotification = mBuilder.build();
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:105: error: cannot find symbol
PinGMusicSongsService.mBuilder.setProgress(0, 0, true);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:108: error: cannot find symbol
PinGMusicSongsService.mBuilder.build());
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:339: error: cannot find symbol
PinGMusicSongsService.mBuilder.setProgress(fileSize, currentDownloadedSize, false);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:341: error: cannot find symbol
PinGMusicSongsService.mNotifyManager.notify(PinGMusicSongsService.notificationID, PinGMusicSongsService.mBuilder.build());
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:350: error: incompatible types
PinGMusicSongsService.mBuilder = new NotificationCompat.Builder(mContext);
^
required: android.support.v7.app.NotificationCompat.Builder
found: android.support.v4.app.NotificationCompat.Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:354: error: cannot find symbol
PinGMusicSongsService.mBuilder.setProgress(0, 0, true);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:355: error: cannot find symbol
PinGMusicSongsService.mNotifyManager.notify(PinGMusicSongsService.notificationID, PinGMusicSongsService.mBuilder.build());
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:395: error: cannot find symbol
PinGMusicSongsService.mBuilder.setProgress(0, 0, false);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\AsyncTasks\AsyncPinSongsTask.java:398: error: cannot find symbol
PinGMusicSongsService.mNotifyManager.notify(PinGMusicSongsService.notificationID, PinGMusicSongsService.mBuilder.build());
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\AutoFetchAlbumArtService.java:60: error: cannot find symbol
notification = builder.build();
^
symbol: method build()
location: variable builder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\PinGMusicSongsService.java:58: error: cannot find symbol
mBuilder.setProgress(0, 0, true);
^
symbol: method setProgress(int,int,boolean)
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\Services\PinGMusicSongsService.java:59: error: cannot find symbol
mNotifyManager.notify(notificationID, mBuilder.build());
^
symbol: method build()
location: variable mBuilder of type Builder
C:\Users\Binoy\AndroidstudioProjects\DrakPlayer\app\src\main\java\com\jams\music\player\WelcomeActivity\MusicFoldersFragment.java:85: error: cannot find symbol
mChildFragmentManager = this.getChildFragmentManager();
^
symbol: method getChildFragmentManager()
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
24 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

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

BUILD FAILED

Total time: 1 mins 26.784 secs

我尝试了以下方法,但均未成功:
  • 清洁并构建
  • 尝试更新支持库v4,v7,v8,v13
  • 删除.gradle / *并构建
  • 检查并在gradle-wrapper.properties中使用各种版本

  • 这是我的app / build.gradle
    apply plugin: 'com.android.application'

    android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
    applicationId "com.vibhinna.music"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion

    //RenderScript backward compatibility for guassian blurs.
    renderscriptTargetApi rootProject.ext.renderscriptTargetApi
    renderscriptSupportModeEnabled true
    }

    buildTypes {
    release {
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
    }
    }

    /**
    * Bug in Gradle v0.7.1. The LICENSE and NOTICE files in the Apache Commons
    * library jars need to be excluded or the project won't compile/build.
    */
    packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    }
    sourceSets {
    instrumentTest.setRoot('src/test')
    main { java.srcDirs = ['src/main/java', 'src/test/java'] } }
    }

    repositories {
    mavenCentral()
    maven { url 'https://dl.bintray.com/ijabz/maven' }
    maven { url "https://jitpack.io" }
    }

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':licensesdialoglibrary')
    compile project(':quickscroll')
    compile project(':velocityviewpagerlibrary')
    compile 'com.android.support:support-v13:23.1.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1@aar'
    compile 'asia.ivity.android:drag-sort-listview:1.0'
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'commons-io:commons-io:2.4'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
    compile 'com.google.http-client:google-http-client:1.20.0'
    compile 'net.jthink:jaudiotagger:2.2.3'
    compile 'com.google.apis:google-api-services-analytics:v3-rev118-1.20.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
    compile 'com.nineoldandroids:parent:2.4.0'
    compile 'com.google.android.gms:play-services:8.1.0'
    }

    最佳答案

    Gradle依赖项和IDE可能会不同步。 Android Studio中有一个按钮将重新同步依赖项。工具-> Android->使用Gradle文件同步项目。

    关于android - Gradle构建因编译时错误而失败,而Android Studio IDE未显示此类错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33397586/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com