SamVerschueren / gulp-cordova-build-android

Gulp plugin for building an android Cordova project
MIT License
14 stars 10 forks source link

Package Name and Problems Parsing Package #10

Closed RDalziel closed 9 years ago

RDalziel commented 9 years ago

Hey!

I'm having a great deal of difficulty in trying to deploy an application to a Nexus 5 Device. I have two problems really

  1. The generated pacakge is ALWAYS "android-debug.apk" or "android-release.apk". Shouldn't it be named with the provided ID?
  2. When attempting to install the package - i get "Parse Error - There was a problem while parsing the package". I've tried messing with minSdkVersion and targetSdkVersion but no luck!

Here's a snipper of my config:

var options = {
    dir: '.cordova',
    id: 'com.package.name',
    name: 'Package Name'
};
return gulp.src('www')
           .pipe(create(options))
           .pipe(description('Description of Application'))
           .pipe(author('AuthorName'))
           .pipe(pref({
               'android-minSdkVersion': '16',
               'android-targetSdkVersion': '22',
               'loadUrlTimeoutValue': '30000'
           }))
           .pipe(android())
           .pipe(gulp.dest('apk'));

Any advice here? Fairly frustrating problem!

SamVerschueren commented 9 years ago

Hi

  1. Yes the generated package is android-debug.apk or android-release.apk. No it should not be named with the provided ID :). This is how cordova spits out the files.
  2. Not sure what this problem can be. Maybe it's a version problem. Can you use gulp-cordova-version and set the version of your application?

Kind regards, Sam

RDalziel commented 9 years ago

Hey Sam,

Thanks for the prompt response!

  1. Would this cause any issues with the package installing on the device? I have had scenarios previously where renaming the package seemed to allow for it to be installed!
  2. No luck. Add the package and still the same problem on the device.

Is there any other additional configuration that would be required to install to a nexus 5?

SamVerschueren commented 9 years ago

Not that I am aware of. This had never happened to me before. Would you mind copy-pasting your generated config.xml file?

RDalziel commented 9 years ago

I've replaced some of the names here but here's the jist:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.product.name" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Product Name</name>
    <description>Description</description>
    <author>AuthorName</author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="22" />
    <preference name="loadUrlTimeoutValue" value="30000" />
</widget>
SamVerschueren commented 9 years ago

The config file seems oke, so that isn't the problem.

You are sure that an application with com.product.name is not yet installed on the device?

RDalziel commented 9 years ago

Yeah it's not installed. But even if it was, would that cause a parse error?

I'm sticking apks onto google drive to get them on the devices, is it possible that could cause the problem?

SamVerschueren commented 9 years ago

I don't think that would cause a parse error, but you never know off course...

Would you be able to install them via adb?

adb install android-debug.apk

Maybe that will give you more information.

RDalziel commented 9 years ago

Will need to get it setup, Sam. Is the error information a bit better there?

RDalziel commented 9 years ago

So...it worked without any issue with ADB! Could this just be an issue with installing from Google Drive?

SamVerschueren commented 9 years ago

I think adb provides more information then a prompt on a device. But glad it worked. I have no clue as to why this isn't working. Have you tried downloading it first from another source, email for example?

RDalziel commented 9 years ago

Yeah definitely more info. I've yet to try this. It did work a few times on Google Drive but i guess it's maybe been trying to install partial APKs. Even although i did wait, and specifically go in and download it.

Either way i have a midway solution, thanks for the help Sam :)

SamVerschueren commented 9 years ago

No problem. If you have any other issues regarding gulp-cordova, don't hesitate to get back to me :).