Comments (19)
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.
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.
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.
from android-directorychooser.
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.
[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.
from android-directorychooser.
Is that in the sample app?
from android-directorychooser.
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.
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.
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:
from android-directorychooser.
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.
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.
@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.
Another option for including co.gu.option is adding this to your build.gradle
dependencies {
compile 'com.gu:option:1.3'
}
from android-directorychooser.
awesome work great
from android-directorychooser.
Thanks. It worked by adding jar file.
from android-directorychooser.
Yep @Phantast's solution is the best one. adding transitive=true will grow your apk by ~800kb
from android-directorychooser.
How about adding the resolution by @Phantast to the readme start-screen?
from android-directorychooser.
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)
- Hidden directories are showing up. HOT 3
- crasch no activity found HOT 1
- Tip: Translations available HOT 1
- does not show big sd cards HOT 1
- App crashes with following stacktrace HOT 1
- language problem HOT 1
- java.lang.NoClassDefFoundError: Failed resolution of: Lcom/freshdesk/hotline/activity/InterstitialActivity
- gradle 1.0-pre-v11 dependency does not work HOT 1
- Crashing on Nexus 6P running Android 8 HOT 1
- Failed to resolve: com.gu:option:1.3 HOT 1
- Unresolved class in the Android Manifest HOT 2
- Uppercase directories sorted before lowercase
- Change title of DirectoryChooserActivity action bar?
- RuntimeException: Manifest merger failed with multiple errors, see logs HOT 1
- option
- Is there a dismissed event?
- Project is not updated. Waste of time. End of project
- Folders are not showing up HOT 1
- Any plans to migrate to androidx's fragments?
- Unresolved class in the Android Manifest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-directorychooser.