jaydeepw / poly-picker

Android library project for providing multiple image selection from the device.
406 stars 114 forks source link

Can't build - possible dependency conflict? #52

Closed ticofab closed 9 years ago

ticofab commented 9 years ago

Hi, sorry for the lenghty issue report. I am unable to build. The main error is Process 'command '/Users/fabiotiriticco/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1. Full exception after running ./gradlew assemble --stacktrace --info is:

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/fabiotiriticco/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1
    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:235)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:222)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 47 more
Caused by: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/fabiotiriticco/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1
    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:42)
    at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:780)
    at com.android.builder.core.AndroidBuilder$processResources$1.call(Unknown Source)
    at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.groovy:145)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.groovy:64)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    ... 53 more
Caused by: org.gradle.process.internal.ExecException: Process 'command '/Users/fabiotiriticco/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:365)
    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:40)
    ... 58 more

Any idea where that might be coming from? Here's my build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId ...
        minSdkVersion 17
        targetSdkVersion 22
        versionCode 3
        versionName "0.1.1"

        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }

    // exclude stuff from final build
    packagingOptions {
        exclude 'LICENSE.txt'
        exclude 'META-INF/services/javax.annotation.processing.Processor'
    }

    lintOptions {
        disable 'InvalidPackage'
    }
}

repositories {
    // maven central repository
    mavenCentral()

    // repository for crop image
    maven { url 'http://lorenzo.villani.me/android-cropimage/' }

    // repository for persistent search bar
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

    // repository for multiple image pick
    maven { url "https://repo.commonsware.com.s3.amazonaws.com" }

}

dependencies {
    // include local jars (if any)
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // android stuff
    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.android.support:cardview-v7:21.0.3'

    // unit tests
    androidTestCompile 'junit:junit:4.12'

    // dagger for dependency injection.
    // http://square.github.io/dagger/
    // 'provided' means that we don't ship it with the APK.
    // This is because we only need the dagger-compiler at compile time.
    compile 'com.squareup.dagger:dagger:1.2.2'
    provided 'com.squareup.dagger:dagger-compiler:1.2.2'

    // retrofit for API interface
    // http://square.github.io/retrofit/
    compile 'com.squareup.retrofit:retrofit:1.9.0'

    // okHttp for HTTP requests
    // http://square.github.io/okhttp/
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'

    // picasso for asynchronous image loading & caching
    // http://square.github.io/picasso/
    compile 'com.squareup.picasso:picasso:2.5.2'

    // Otto for event publishing bus
    // http://square.github.io/otto/
    compile 'com.squareup:otto:1.3.6'

    // JodaTime for Android
    // https://github.com/dlew/joda-time-android
    compile 'net.danlew:android.joda:2.7.1'

    // facebook SDK for Android
    compile 'com.facebook.android:facebook-android-sdk:3.22.0'

    // floating action button
    // https://github.com/futuresimple/android-floating-action-button
    compile 'com.getbase:floatingactionbutton:1.9.0'

    // butter knife for views injection
    // http://goo.gl/2HBGLT
    compile 'com.jakewharton:butterknife:6.1.0'

    // super recycler view
    // https://github.com/Malinskiy/SuperRecyclerView
    compile 'com.malinskiy:superrecyclerview:1.1.0'

    // websocket library
    // https://github.com/TooTallNate/Java-WebSocket
    compile "org.java-websocket:Java-WebSocket:1.3.0"

    // snackbar for actions
    // https://github.com/nispok/snackbar
    compile 'com.nispok:snackbar:2.10.7'

    // crop image
    // see added repository on top
    // https://github.com/lvillani/android-cropimage
    compile 'me.villani.lorenzo.android:android-cropimage:1.1.0'

    // circular image view for profile pictures
    // https://github.com/hdodenhof/CircleImageView
    compile 'de.hdodenhof:circleimageview:1.3.0'

    // better date picker for birth date
    // https://github.com/derekbrameyer/android-betterpickers
    compile 'com.doomonafireball.betterpickers:library:1.5.5'

    // material progress bar
    // https://github.com/lsjwzh/MaterialLoadingProgressBar
    compile('com.lsjwzh:materialloadingprogressbar:0.5.5-RELEASE')

    // persistent search bar
    // https://github.com/Quinny898/PersistentSearch
    compile 'com.quinny898.library.persistentsearch:library:1.0.0-SNAPSHOT'

    // material calendar
    // https://github.com/prolificinteractive/material-calendarview
    compile 'com.prolificinteractive:material-calendarview:0.3.2'

    // time picker
    // https://github.com/erz05/TimePicker
    compile 'com.github.erz05:TimePicker:0.1.2@aar'

    // multiple image pick
    // https://github.com/jaydeepw/poly-picker
    compile 'net.the4thdimension:poly-picker:1.0.11'
}

I would really like to be able to build and try out this library. Thanks for any help and sorry for the lenghty issue report. Fabio

jaydeepw commented 9 years ago

Try different version of gradle build tools. I have been into such crashes. Also clean and then build the project.

If you just want to try this library out, clone the repo and import the PolyPickerDemo project into your Android Studio. It shall compile and install.

ticofab commented 9 years ago

Hey @jaydeepw , thank you very much for your swift response. I was just able to solve the problem, and I have found the reason why. There was a problem with duplicate names, in particular two:

ic_launcher.png
activity_horizontal_margin (in values.xml)

After renaming those two in my own project, I was able to build. Because this is a general library, I would recommend that those be changed into something more specific, such as

ic_poly_picker_launcher.png
activity_poly_picker_horizontal_margin

If you want, I can take care of this simple renaming and submit a pull request? I could also submit translations for a couple of languages. Thank you again for your assistance!

jaydeepw commented 9 years ago

Ahh... okay. Probably resource merging works different now. I have also had conflicting names for resources but never entered into this situation.

Thanks for responding back.

Please send PR with name fixes and translation as you feel right. I shall merge the PR.

Please use ic_pp_launcher and activitypp....

Use pp instead of poly_picker. I have used the same for the Activity layout name. Lets follow the same.