android - FileProvider - name must not be empty -


i have following fileprovider in manifest :

    <provider         android:name="android.support.v4.content.fileprovider"         android:authorities="com.android.provider.datasharing-1"         android:exported="false"         android:granturipermissions="true">          <meta-data             android:name="android.support.file_provider_paths"             android:resource="@xml/paths"/>      </provider> 

i getting following exception on app launch :

 java.lang.runtimeexception: unable provider android.support.v4.content.fileprovider: java.lang.illegalargumentexception: name must not empty         @ android.app.activitythread.installprovider(activitythread.java:4793)         @ android.app.activitythread.installcontentproviders(activitythread.java:4385)         @ android.app.activitythread.handlebindapplication(activitythread.java:4325)         @ android.app.activitythread.access$1500(activitythread.java:135)         @ android.app.activitythread$h.handlemessage(activitythread.java:1256)         @ android.os.handler.dispatchmessage(handler.java:102)         @ android.os.looper.loop(looper.java:136)         @ android.app.activitythread.main(activitythread.java:5017)         @ java.lang.reflect.method.invokenative(native method)         @ java.lang.reflect.method.invoke(method.java:515)         @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779)         @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595)         @ dalvik.system.nativestart.main(native method)  caused by: java.lang.illegalargumentexception: name must not empty         @ android.support.v4.content.fileprovider$simplepathstrategy.addroot(fileprovider.java:644)         @ android.support.v4.content.fileprovider.parsepathstrategy(fileprovider.java:587)         @ android.support.v4.content.fileprovider.getpathstrategy(fileprovider.java:534)         @ android.support.v4.content.fileprovider.attachinfo(fileprovider.java:352)         @ android.app.activitythread.installprovider(activitythread.java:4790) ... 

how resolve ? did miss specifying name ?

edit :

res/xml/paths.xml

<paths xmlns:android="http://schemas.android.com/apk/res/android">      <files-path android:name="my_images" android:path="images/"/> </paths> 

remove android: prefix attributes in paths.xml file. should like:

<paths xmlns:android="http://schemas.android.com/apk/res/android">     <files-path name="my_images" path="images/"/> </paths> 

(and can rid of xmlns:android bit too, since it's not used, though have in one of mine, perhaps because eclipse put there when creating file...)


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -