Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Android deployment problem

Options
  • 07-12-2017 10:45am
    #1
    Registered Users Posts: 1,603 ✭✭✭


    I use Android Studio to develop some basic apps and I deploy them directly on my phone , or friends phones , simply by emailing the signed apk. I use the same signed certificate for all apps.This has worked fine up till now. However my latest app wont install.

    The app itself is simple, it uses the cameras the switch on and off the flash. essentially giving me a torch. My phone is Samsung S4 and has Android 5.0.1

    I have connected is phone to laptop, Windows 10, for testing and debugging and it works perfectly. I then deleted this test/debug version from the phone.
    I created a signed release version , copied it to the phone ( using Bluetooth) and opened it using the default installer.
    This is where the problem arises. The installer, after a few moments, just reports that the app was not installed.

    I appreciate that the query is very general, but is there anything I could be doing wrong. I am fairly sure this worked before without a problem. The only permission needed is camera.
    One other app on the phone uses the same signing certificate. But this seems to be accepted practice ( in fact it seems recommended).
    I have reinstalled the debug version, using Android Studio and it works fine, and gives me the torch I wanted, but I would prefer to get to the bottom of this

    Would be grateful for any help. Or direction where I might start. I can post code and manifest files it that is any help.

    thanks for reading such a long post


Comments

  • Registered Users Posts: 6,252 ✭✭✭Buford T Justice


    rock22 wrote: »
    I use Android Studio to develop some basic apps and I deploy them directly on my phone , or friends phones , simply by emailing the signed apk. I use the same signed certificate for all apps.This has worked fine up till now. However my latest app wont install.

    The app itself is simple, it uses the cameras the switch on and off the flash. essentially giving me a torch. My phone is Samsung S4 and has Android 5.0.1

    I have connected is phone to laptop, Windows 10, for testing and debugging and it works perfectly. I then deleted this test/debug version from the phone.
    I created a signed release version , copied it to the phone ( using Bluetooth) and opened it using the default installer.
    This is where the problem arises. The installer, after a few moments, just reports that the app was not installed.

    I appreciate that the query is very general, but is there anything I could be doing wrong. I am fairly sure this worked before without a problem. The only permission needed is camera.
    One other app on the phone uses the same signing certificate. But this seems to be accepted practice ( in fact it seems recommended).
    I have reinstalled the debug version, using Android Studio and it works fine, and gives me the torch I wanted, but I would prefer to get to the bottom of this

    Would be grateful for any help. Or direction where I might start. I can post code and manifest files it that is any help.

    thanks for reading such a long post

    Have you looked at the logcat output while trying the install?


  • Registered Users Posts: 1,603 ✭✭✭rock22


    Have you looked at the logcat output while trying the install?

    Thanks Buford
    Is this produced on the phone? Can you direct me to where I might find it. Thanks


  • Registered Users Posts: 6,252 ✭✭✭Buford T Justice


    rock22 wrote: »
    Thanks Buford
    Is this produced on the phone? Can you direct me to where I might find it. Thanks

    If you're phone is connected to the computer via usb then android studio logcat should help


  • Registered Users Posts: 1,603 ✭✭✭rock22


    If you're phone is connected to the computer via usb then android studio logcat should help

    Can I install the signed app directly from Android Studio to a connected phone?
    I have been following the instructions here

    I will try to do it directly with the phone connected.
    The app itself, as I said, simple displays an image , which when 'clicked' toggles the camera flash on or off.


  • Registered Users Posts: 6,252 ✭✭✭Buford T Justice


    rock22 wrote: »
    Can I install the signed app directly from Android Studio to a connected phone?
    I have been following the instructions here

    I will try to do it directly with the phone connected.
    The app itself, as I said, simple displays an image , which when 'clicked' toggles the camera flash on or off.

    The log cat should spit out all message from the device, so keep an eye on it when you try to install. Its failing for a reason, and this might lead you in the direction you need.


  • Advertisement
  • Registered Users Posts: 11,262 ✭✭✭✭jester77


    rock22 wrote: »
    Can I install the signed app directly from Android Studio to a connected phone?
    I have been following the instructions here

    I will try to do it directly with the phone connected.
    The app itself, as I said, simple displays an image , which when 'clicked' toggles the camera flash on or off.

    I find the easiest way to install it the app is to use the gradle wrapper from the CLI.
    ./gradlew clean installXXX
    

    XXX being your build variant i.e. Debug, Test, Release, etc


  • Registered Users Posts: 1,603 ✭✭✭rock22


    Ok , I will read up a bit about deployment from Studio and Gradle wrapper.
    To be honest, I develop about 1 app a year and so far I haven't had to learn too much about Gradle ( or Studio!). I Usually just select the Generate Signed apk from the menu and follow the instruction.
    I will test later today on an other device , unfortunately Android 4.4 so I will have to select different target sdk, and also I will try some simple 'hello world' apps and see if they get deployed correctly

    Thanks to you all for help


  • Registered Users Posts: 11,262 ✭✭✭✭jester77


    rock22 wrote: »
    Ok , I will read up a bit about deployment from Studio and Gradle wrapper.
    To be honest, I develop about 1 app a year and so far I haven't had to learn too much about Gradle ( or Studio!). I Usually just select the Generate Signed apk from the menu and follow the instruction.
    I will test later today on an other device , unfortunately Android 4.4 so I will have to select different target sdk, and also I will try some simple 'hello world' apps and see if they get deployed correctly

    Thanks to you all for help

    You don't need to set a different target SDK, set target to the highest device you support, or better the latest version that is out there.

    It is your minimum sdk that you might need to change if it doesn't already support 4.4. Just make sure you are using the support libraries and you won't have any issues with older devices.


  • Registered Users Posts: 1,603 ✭✭✭rock22


    Well I have updated Android Studio to nesest(3.0) vrsion and coded a simple hello workd app.
    I have debugged it on a Note Tablet , connected via usb , directly in Android studio.
    All working ok
    I then generated a sign apk copied it vis email , And again it failed to install.
    I then created a new key and generated another release -apk. With the same result!

    When it try to build just using the run icon but build variant set to 'release' it asks for the key. But when I select the key, either the old or new key, it gives me an error.
    When I continue I get this message "Installation failed with message INSTALL_PARSE_FAILED_NO_CERTIFICATES."
    I looks like it is allowing me select a key but not including it for some reason,

    I would be grateful for any ideas

    regards
    g


  • Registered Users Posts: 6,252 ✭✭✭Buford T Justice


    rock22 wrote: »
    Well I have updated Android Studio to nesest(3.0) vrsion and coded a simple hello workd app.
    I have debugged it on a Note Tablet , connected via usb , directly in Android studio.
    All working ok
    I then generated a sign apk copied it vis email , And again it failed to install.
    I then created a new key and generated another release -apk. With the same result!

    When it try to build just using the run icon but build variant set to 'release' it asks for the key. But when I select the key, either the old or new key, it gives me an error.
    When I continue I get this message "Installation failed with message INSTALL_PARSE_FAILED_NO_CERTIFICATES."
    I looks like it is allowing me select a key but not including it for some reason,

    I would be grateful for any ideas

    regards
    g

    It sounds like the key you're using to sign it is failing, or its invalid hence no signing is happening


  • Advertisement
  • Registered Users Posts: 1,603 ✭✭✭rock22


    It sounds like the key you're using to sign it is failing, or its invalid hence no signing is happening

    That was the problem.
    I did create a new key and put it into the same store but that failed.
    When I created a new store and new key it worked. At least with the "Hello World" app.
    The iriginal store must be corrupted in some way even thought when I select the store and then click on the select button it shows the two keys there. But both fail.

    Now back to the torch app. Clearly I need to spend more time coding so these problems don't occur

    Thanks again Buford and Jester for all the help


Advertisement