Reading file from assets directory throws FileNotFoundException

后端 未结 2 606
终归单人心
终归单人心 2020-12-30 02:42

I\'m trying to read in a text file of a bunch of words that I want to use for a word game I am writing. This list is stored in the assets directory and is a txt file. But, w

相关标签:
2条回答
  • 2020-12-30 02:50

    on Maven, the Assets folder needs to be inside projectName/ not inside projectName/src/main as suggested in other examples.

    Source:

    http://jayway.github.io/maven-android-plugin/generate-sources-mojo.html

    0 讨论(0)
  • 2020-12-30 02:53

    Check whether the file was properly packaged in the assets folder inside the .apk file. (It can be browsed as a zip file. Rename it if necessary to look inside.)

    0 讨论(0)
提交回复
热议问题