getResources(). openRawResource Resources$Notfoundexception

Asked

Viewed 285 times

0

I use the command

InputStream input = getResources().openRawResource(R.raw.tabelas);

no problem in an app.

Only if you use the same command in a new application, the error occurs

android.content.res.Resources$NotFoundException: Resource ID #0x7f060001
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5254)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
     Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f060001
            at android.content.res.Resources.getValue(Resources.java:1266)
            at android.content.res.Resources.openRawResource(Resources.java:1181)
            at android.content.res.Resources.openRawResource(Resources.java:1158)
            at rankingfute.ideiainformatica.br.rankingfutebol.PrincipalActivity.onCreate(PrincipalActivity.java:69)

Line 69 is exactly in command:

InputStream input = getResources().openRawResource(R.raw.pontuacao);

What’s the difference besides the contents of the tables files and score?

  • 1

    It means that the file pontuacao.xml inside the directory res/raw was not found. You verified the existence of it?

  • There are mistakes in your .xml ?

  • The file is named "score.txt" as in the other application is "tables.txt".

  • The application comes to run and points no error

  • It is a text file that I handle within the system. Are there any restrictions on this? Something like record size or size limit?

  • There is a difference between the two apps: in what works and is in Google Play, in front of the tables.txt name has nothing, and in this new one has "(nokeys)" in front of the.txt score. I tried to rename to only "score" and gave the same problem. What nokeys is this?

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.