GithubHelp home page GithubHelp logo

Comments (19)

Phantast avatar Phantast commented on August 15, 2024 31

As this thread is quite long, here the summary of what solved it for me:

repositories {
    maven { url 'http://guardian.github.com/maven/repo-releases' }
}

dependencies {
    compile 'com.gu:option:1.3'
    compile 'net.rdrei.android.dirchooser:library:3.2@aar'
}

Hope it helps somebody else when checking this issue.

from android-directorychooser.

javiersantos avatar javiersantos commented on August 15, 2024 11

Fixed. I have included this lines in my own build.gradle

repositories {
    mavenCentral()
    maven { url 'http://guardian.github.com/maven/repo-releases' }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    ...
    compile ('net.rdrei.android.dirchooser:library:3.0@aar') { transitive = true; }
}

from android-directorychooser.

javiersantos avatar javiersantos commented on August 15, 2024 3

Seems to be fixed when including transitive = true in gradle:

compile ('net.rdrei.android.dirchooser:library:3.0@aar') {
        transitive = true;
}

Then it tries to include com.gu:options, but gradle is not able to resolve the library.
screen shot 2015-08-19 at 11 06 19

from android-directorychooser.

blackvvine avatar blackvvine commented on August 15, 2024 2

I Don't know if it's just me or what, but I couldn't find a valid Maven repoistory on Guardian's "gu.options" github directory.
So I just downloaded Option 1.3 JAR file from:
http://guardian.github.io/maven/repo-releases/com/gu/option/1.3/option-1.3.jar
and everything's OK now.

from android-directorychooser.

blackvvine avatar blackvvine commented on August 15, 2024 2

[BASICS]
Just copy the JAR file to your app's "libs" folder and put the following in your app's "build.gradle" file:
compile files('libs/option-1.3.jar')

It's a great library BTW.

from android-directorychooser.

passy avatar passy commented on August 15, 2024 1

👍 Thanks for documenting that!

from android-directorychooser.

passy avatar passy commented on August 15, 2024

Is that in the sample app?

from android-directorychooser.

javiersantos avatar javiersantos commented on August 15, 2024

No, it happens using my own implementation in a Preference object on the PreferenceActivity class. I have not tested the sample app.

prefCustomPath = findPreference("prefCustomPath");

prefCustomPath.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(Preference preference) {
                final Intent chooserIntent = new Intent(context, DirectoryChooserActivity.class);

                final DirectoryChooserConfig chooserConfig = DirectoryChooserConfig.builder()
                        .newDirectoryName("Dir")
                        .allowReadOnlyDirectory(false)
                        .allowNewDirectoryNameModification(true)
                        .build();

                chooserIntent.putExtra(DirectoryChooserActivity.EXTRA_CONFIG, chooserConfig);
                startActivityForResult(chooserIntent, REQUEST_DIRECTORY);

                return false;
            }
        });

Thanks.

from android-directorychooser.

javiersantos avatar javiersantos commented on August 15, 2024

Well, it fails when using the Fragment too (same Logcat).

prefCustomPath.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(Preference preference) {
                final DirectoryChooserConfig chooserConfig = DirectoryChooserConfig.builder()
                        .newDirectoryName("Dir")
                        .allowReadOnlyDirectory(false)
                        .allowNewDirectoryNameModification(true)
                        .build();

                final DirectoryChooserFragment chooserDialog =                                                                 DirectoryChooserFragment.newInstance(chooserConfig);
                chooserDialog.show(getFragmentManager(), null);

                return false;
            }
});

from android-directorychooser.

passy avatar passy commented on August 15, 2024

Yeah, this has nothing to do with the code there. Something with your build is broken, it seems that the transitive dependencies aren't included. It is declared as a dependency of the library though:

compile 'com.gu:option:1.3'

from android-directorychooser.

rommex avatar rommex commented on August 15, 2024

After all the fixes by @javiersantos there is still a new error message:

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 2

from android-directorychooser.

javiersantos avatar javiersantos commented on August 15, 2024

What about adding this to your build.gradle @rommex?

defaultConfig {
    multiDexEnabled true
}

I think it happens because you have exceeded the 65K methods dex limit imposed by Android.

from android-directorychooser.

rommex avatar rommex commented on August 15, 2024

@javiersantos thanks for your swift support. But your suggested insertions lead to some other nasty messages:

Error:duplicate files during packaging of APK D:\My Documents\AndroidStudioProjects\RayStoryBoard\app\build\outputs\apk\app-debug-unaligned.apk
Path in archive: META-INF/services/javax.annotation.processing.Processor
Origin 1: E:.gradle\caches\modules-2\files-2.1\com.google.auto.value\auto-value\1.1\f6951c141ea3e89c0f8b01da16834880a1ebf162\auto-value-1.1.jar
Origin 2: E:.gradle\caches\modules-2\files-2.1\com.jakewharton\butterknife\6.1.0\63735f48b82bcd24cdd33821342428252eb1ca5a\butterknife-6.1.0.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}

from android-directorychooser.

ericbutler avatar ericbutler commented on August 15, 2024

Another option for including co.gu.option is adding this to your build.gradle

dependencies {
compile 'com.gu:option:1.3'
}

from android-directorychooser.

 avatar commented on August 15, 2024

awesome work great

from android-directorychooser.

popdeveloper avatar popdeveloper commented on August 15, 2024

Thanks. It worked by adding jar file.

from android-directorychooser.

micwallace avatar micwallace commented on August 15, 2024

Yep @Phantast's solution is the best one. adding transitive=true will grow your apk by ~800kb

from android-directorychooser.

apacha avatar apacha commented on August 15, 2024

How about adding the resolution by @Phantast to the readme start-screen?

from android-directorychooser.

Phantast avatar Phantast commented on August 15, 2024

It is quite some time ago since I faced this issue. Go ahead and add it. ;) I dont feel safe enough to make these changes.

from android-directorychooser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.