0
votes

I am building my first app in android studio but my app crash when I try to open it. I am very new to this and I don't even know what I can show you to solve my problem.

What should I do to solve this problem?

This is what i get from logcat:

--------- beginning of crash 09-06 06:45:25.516 4182-4182/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.android.questionnaireapplication, PID: 4182 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.questionnaireapplication/com.example.android.questionnaireapplication.QuestionnaireActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:331) at android.widget.TextView.setText(TextView.java:4554) at com.example.android.questionnaireapplication.QuestionnaireActivity.mettreÀJourQuestion(QuestionnaireActivity.java:38) at com.example.android.questionnaireapplication.QuestionnaireActivity.onCreate(QuestionnaireActivity.java:49) at android.app.Activity.performCreate(Activity.java:6662) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6077)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) 

1
I am trying to use stacktrace but where exactly does the stacktrace is created ? I can't find any when my app crashes.Gabriel Lemire

1 Answers

0
votes

Below portion of stacktrace should be useful for you as it says that you have a problem on line 38 in QuestionnaireActivity.java which is actually a resource not found exception, i-e string resource you are using to set text in your text view is not a valid resource.

Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:331) at android.widget.TextView.setText(TextView.java:4554) at com.example.android.questionnaireapplication.QuestionnaireActivity.mettreÀJourQuestion(QuestionnaireActivity.java:38) at