NanoHttpd / nanohttpd

Tiny, easily embeddable HTTP server in Java.
http://nanohttpd.org
BSD 3-Clause "New" or "Revised" License
6.89k stars 1.69k forks source link

Problems on Android - META-INF #528

Open paulocoutinhox opened 5 years ago

paulocoutinhox commented 5 years ago

Hi,

Im trying use nanohttp on Android, but when i use and build i got this error:

More than one file was found with OS independent path 'META-INF/nanohttpd/default-mimetypes.properties'

With this dependencies:

implementation 'org.nanohttpd:nanohttpd-nanolets:2.3.1'
implementation 'org.nanohttpd:nanohttpd:2.3.1'

Can anyone help me?

b202i commented 5 years ago

I just pasted the source code into a .java file and tailored it from there.

Example in DeepDive

kenMarquez commented 4 years ago

Same problem, did you solve it?

paulocoutinhox commented 4 years ago

Hi,

I solve it using snapshot version:

implementation 'org.nanohttpd:nanohttpd:2.3.2-SNAPSHOT'
implementation 'org.nanohttpd:nanohttpd-nanolets:2.3.2-SNAPSHOT'

Thanks.

kenMarquez commented 4 years ago

After all, I understood that Android tried to generate the apk with several 'META-INF/nanohttpd/*' from several libraries, then I simply combined all of these, and it worked for me adding this on my app/build.gradle.

andorid { .... packagingOptions { merge 'META-INF/nanohttpd/*' } }