0
I finished a small application that saves notes and I’m trying to generate Signed apk, but it doesn’t work on my phone.
- I have tested generating a Signed apk from a new project with only a Blank Activity and the same worked normally on my phone.
- I redid the process of generating Signed apk about 10x and none of them worked.
- My application works normally in the emulator by Android Studio (which leaves me without understanding the problem of not working on my phone).
My little project is on github and has only 2 Activity’s, meaning it’s not complex...
I would appreciate it if someone could take a look at me...(remembering that I have already researched a lot on the internet and tried several options). thanks in advance!
project link on github: https://github.com/LucasBaltazar/Simple-Notes
download and try to generate Signed apk to see, I await answers!
Editing
This project gives this error:
01-07 16:35:55.009 16335-16335/com.lbttecnology.Notes E/Androidruntime FATAL EXCEPTION: main java.lang.Runtimeexception: Unable to start Activity Componentinfo{com.lbttecnology.Notes/com.lbttecnology.Notes.Notesactivity}: java.lang.Illegalstateexception: Cannot add header view to list -- setAdapter has already been called. at android.app.Activitythread.performLaunchActivity(Activitythread.java:2394) at android.app.Activitythread.handleLaunchActivity(Activitythread.java:2446) at android.app.Activitythread.access$600(Activitythread.java:165) at android.app.Activitythread$H.handleMessage(Activitythread.java:1373) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.Activitythread.main(Activitythread.java:5434) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.Internal.os.Zygoteinit$Methodandargscaller.run(Zygoteinit.java:834) at com.android.Internal.os.Zygoteinit.main(Zygoteinit.java:601) at Dalvik.system.Nativestart.main(Native Method) Caused by: java.lang.Illegalstateexception: Cannot add header view to list -- setAdapter has already been called. at android.widget.Listview.addHeaderView(Listview.java:261) at android.widget.Listview.addHeaderView(Listview.java:290) with.lbttecnology.Notes.NotesActivity.onCreate(Notesactivity.java:53) at android.app.Activity.performCreate(Activity.java:5122) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146) at android.app.Activitythread.performLaunchActivity(Activitythread.java:2358) at android.app.Activitythread.handleLaunchActivity(Activitythread.java:2446) at android.app.Activitythread.access$600(Activitythread.java:165) at android.app.Activitythread$H.handleMessage(Activitythread.java:1373) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.Activitythread.main(Activitythread.java:5434) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.Internal.os.Zygoteinit$Methodandargscaller.run(Zygoteinit.java:834) at com.android.Internal.os.Zygoteinit.main(Zygoteinit.java:601) at Dalvik.system.Nativestart.main(Native Method)
Which one
android:targetSdkVersion
? And what version of your Android on mobile?– Jorge B.
cellular: 4.1.2(16) // project: minSdkVersion 15 targetSdkVersion 21
– Baltazar
But does it install on your phone? What exactly happens?
– Jorge B.
It installs normally though, when I click on its icon to run the application it gives me the following message: "Notes stopped"
– Baltazar
If you can download the project on github and look there on your machine, I believe that maybe you can solve...
– Baltazar
I changed the question with the error generated by your application. There is any problem. Do not use the logcat you to test?
– Jorge B.
So, in my emulator does not generate error.. I have checked the problem you posted, fixed, generated the apk and installed on my phone and ran normally.
– Baltazar
First of all, thank you very much, I am very grateful for your help!
– Baltazar