Can you be more specific about what problem you are having?
Rob:
See Martin’s comments above dated 11-May-2013 and 15-May-2013 (over 1 year ago!). This is a small but annoying problem for those of us that are familiar with ant / android but new to Corona enterprise. Your sample build scripts don’t work for debug builds.
I’m just reiterating Martin’s comments that some small cleanup of your samples would help so much when getting started. I’m evaluating Enterprise right now and while I’ve been able to work through these types of problems, issues like this makes the first time experience with Enterprise less appealing.
We kind of addressed this in the Android Enterprise tutorial: http://coronalabs.com/blog/2014/04/01/tutorial-corona-enterprise-quickstart-android/
Look for the “Signing” topics. Since I have practically no experience with Android development, I spent a lot of time trying to figure this out and tried to find a way to simplify this for SDK users who like me are coming from little to no experience. Take a look at it and see if that provides any insight.
Rob
Wow – this problem still exists. It would help so much if just a little more love was given to the examples.
Can you be more specific about what problem you are having?
Rob:
See Martin’s comments above dated 11-May-2013 and 15-May-2013 (over 1 year ago!). This is a small but annoying problem for those of us that are familiar with ant / android but new to Corona enterprise. Your sample build scripts don’t work for debug builds.
I’m just reiterating Martin’s comments that some small cleanup of your samples would help so much when getting started. I’m evaluating Enterprise right now and while I’ve been able to work through these types of problems, issues like this makes the first time experience with Enterprise less appealing.
We kind of addressed this in the Android Enterprise tutorial: http://coronalabs.com/blog/2014/04/01/tutorial-corona-enterprise-quickstart-android/
Look for the “Signing” topics. Since I have practically no experience with Android development, I spent a lot of time trying to figure this out and tried to find a way to simplify this for SDK users who like me are coming from little to no experience. Take a look at it and see if that provides any insight.
Rob
I have just installed the enterprise trial and followed the steps in the android quickstart tutorial. Everything works, EXCEPT when doing the build_debug.sh . It will create the apks successfully but they will NOT install on a device and fail with the following:
4985 KB/s (7812960 bytes in 1.530s)
pkg: /data/local/tmp/Unscramble Anagram-debug.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Can somebody help me with this? When I do a normal build for release and sign it with my private keystore the app will install successfully. I’d really like to get debug builds working properly because it is a big pain to keep inputing 2 VERY long passwords everytime I want to do a build.
Thanks!
Here are my build_debug.sh and build.xml files (both directly taken from the android tutorial):
build_debug.sh:
#!/bin/bash # ------------------------------------------------------------------------------------------ # Builds the sample project from the command line. # # You must provide the path to the root Android SDK directory by doing one of the following: # 1) Provide the path as a comman line argument. For example: build.sh \<MyAndroidSdkPath\> # 2) Set the path to an environment variable named "ANDROID\_SDK". # ------------------------------------------------------------------------------------------ # # Checks exit value for error # checkError() { if [$? -ne 0] then echo "Exiting due to errors (above)" exit -1 fi } script=`basename $0` path=`dirname $0` # # Canonicalize relative paths to absolute paths # pushd $path \> /dev/null dir=`pwd` path=$dir popd \> /dev/null # Fetch the Android SDK path from the first command line argument. # If not provided from the command line, then attempt to fetch it from environment variable ANDROID\_SDK. SDK\_PATH= if [! -z "$1"] then SDK\_PATH=$1 else SDK\_PATH=$ANDROID\_SDK fi if [-z "$CORONA\_ENTERPRISE\_DIR"] then CORONA\_ENTERPRISE\_DIR=/Applications/CoronaEnterprise fi if [! -z "$2"] then CORONA\_PATH=$2 else CORONA\_PATH=$CORONA\_ENTERPRISE\_DIR fi RELATIVE\_PATH\_TOOL=$CORONA\_PATH/Corona/mac/bin/relativePath.sh CORONA\_PATH=`"$RELATIVE_PATH_TOOL" "$path" "$CORONA_PATH"` echo CORONA\_PATH: $CORONA\_PATH # Do not continue if we do not have the path to the Android SDK. if [-z "$SDK\_PATH"] then echo "" echo "USAGE: $script" echo "USAGE: $script android\_sdk\_path" echo "USAGE: $script android\_sdk\_path corona\_enterprise\_path" echo "\tandroid\_sdk\_path: Path to the root Android SDK directory." echo "\tcorona\_enterprise\_path: Path to the CoronaEnterprise directory." exit -1 fi # Before we can do a build, we must update all Android project directories to use the given Android SDK. # We do this by running the "android" command line tool. This will add a "local.properties" file to all # project directories that is required by the Ant build system to compile these projects for Android. "$SDK\_PATH/tools/android" update project -p . checkError "$SDK\_PATH/tools/android" update lib-project -p "$CORONA\_PATH/Corona/android/lib/Corona" checkError echo "Using Corona Enterprise Dir: $CORONA\_PATH" # Build the Test project via the Ant build system. ant debug -D"CoronaEnterpriseDir"="$CORONA\_PATH" checkError
build.xml:
\<?xml version="1.0" encoding="UTF-8"?\> \<project name="Unscramble Anagram" default="help"\> \<!-- The local.properties file is created and updated by the 'android' tool. It contains the path to the SDK. It should \*NOT\* be checked into Version Control Systems. --\> \<property file="local.properties" /\> \<!-- The ant.properties file can be created by you. It is only edited by the 'android' tool to add properties to it. This is the place to change some Ant specific build properties. Here are some properties you may want to change/update: source.dir The name of the source directory. Default is 'src'. out.dir The name of the output directory. Default is 'bin'. For other overridable properties, look at the beginning of the rules files in the SDK, at tools/ant/build.xml Properties related to the SDK location or the project target should be updated using the 'android' tool with the 'update' action. This file is an integral part of the build system for your application and should be checked into Version Control Systems. --\> \<property file="ant.properties" /\> \<!-- The project.properties file is created and updated by the 'android' tool, as well as ADT. This contains project specific properties such as project target, and library dependencies. Lower level build properties are stored in ant.properties (or in .classpath for Eclipse projects). This file is an integral part of the build system for your application and should be checked into Version Control Systems. --\> \<loadproperties srcFile="project.properties" /\> \<!-- quick check on sdk.dir --\> \<fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" unless="sdk.dir" /\> \<!-- Import per project custom build rules if present at the root of the project. This is the place to put custom intermediary targets such as: -pre-build -pre-compile -post-compile (This is typically used for code obfuscation. Compiled code location: ${out.classes.absolute.dir} If this is not done in place, override ${out.dex.input.absolute.dir}) -post-package -post-build -pre-clean --\> \<import file="custom\_rules.xml" optional="true" /\> \<!-- Import the actual build file. To customize existing targets, there are two options: - Customize only one target: - copy/paste the target into this file, \*before\* the \<import\> task. - customize it to your needs. - Customize the whole content of build.xml - copy/paste the content of the rules files (minus the top node) into this file, replacing the \<import\> task. - customize to your needs. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\*\*\*\*\* IMPORTANT \*\*\*\*\*\* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* In all cases you must update the value of version-tag below to read 'custom' instead of an integer, in order to avoid having your file be overridden by tools such as "android update project" --\> \<!-- version-tag: custom --\> \<import file="${sdk.dir}/tools/ant/build.xml" /\> \<!-- Run the "Corona Builder" in the pre-build step. --\> \<target name="-pre-build"\> \<mkdir dir="${basedir}/assets" /\> \<exec executable="${CoronaEnterpriseDir}/Corona/mac/bin/lua" failonerror="true"\> \<arg value="-e" /\> \<arg value="package.path='${CoronaEnterpriseDir}/Corona/shared/bin/?.lua;${CoronaEnterpriseDir}/Corona/shared/bin/?/init.lua;'..package.path" /\> \<arg value="${CoronaEnterpriseDir}/Corona/shared/bin/Compile.lua" /\> \<arg value="mac" /\> \<arg value="${CoronaEnterpriseDir}" /\> \<env key="LUA\_CPATH" value="${CoronaEnterpriseDir}/Corona/mac/bin/?.so"/\> \<env key="TARGET\_PLATFORM" value="android"/\> \<env key="PROJECT\_DIR" value="${basedir}"/\> \<env key="CORONA\_COPY\_PNG\_PRESERVE" value="--preserve"/\> \<env key="CONFIGURATION" value="${ant.project.invoked-targets}"/\> \<env key="CORONA\_ASSETS\_DIR" value="${basedir}/../Corona"/\> \<env key="CORONA\_TARGET\_RESOURCES\_DIR" value="${basedir}/assets"/\> \<env key="CORONA\_TARGET\_EXECUTABLE\_DIR" value="${basedir}/assets"/\> \</exec\> \</target\> \<!-- This certifies the built APK before digitally signing it. --\> \<target name="-post-package"\> \<exec executable="${CoronaEnterpriseDir}/Corona/mac/bin/CertifyBuild.sh" failonerror="true"\> \<env key="CORONA\_APK\_PATH" value="${out.packaged.file}"/\> \<env key="CORONA\_RESOURCE\_CAR\_PATH" value="${basedir}/assets"/\> \</exec\> \</target\> \</project\>
I also have the ant.properties file created with my keystore info entered in.
Create a file called: secure.properties in your folder. To it add these two lines:
key.store.password=yourkeystorepassword
key.alias.password=youraliaspassword
Now you’re putting this in a clear text file which isn’t the most secure thing to do, but if you’re the only one on your computer and you don’t allow people to access your hard drive remotely, it shouldn’t be a problem.
Then add this: <property file=“secure.properties” />
to your build.xml right after the <project name=“blahblahblah”> line.
Rob
I have just installed the enterprise trial and followed the steps in the android quickstart tutorial. Everything works, EXCEPT when doing the build_debug.sh . It will create the apks successfully but they will NOT install on a device and fail with the following:
4985 KB/s (7812960 bytes in 1.530s)
pkg: /data/local/tmp/Unscramble Anagram-debug.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Can somebody help me with this? When I do a normal build for release and sign it with my private keystore the app will install successfully. I’d really like to get debug builds working properly because it is a big pain to keep inputing 2 VERY long passwords everytime I want to do a build.
Thanks!
Here are my build_debug.sh and build.xml files (both directly taken from the android tutorial):
build_debug.sh:
#!/bin/bash # ------------------------------------------------------------------------------------------ # Builds the sample project from the command line. # # You must provide the path to the root Android SDK directory by doing one of the following: # 1) Provide the path as a comman line argument. For example: build.sh \<MyAndroidSdkPath\> # 2) Set the path to an environment variable named "ANDROID\_SDK". # ------------------------------------------------------------------------------------------ # # Checks exit value for error # checkError() { if [$? -ne 0] then echo "Exiting due to errors (above)" exit -1 fi } script=`basename $0` path=`dirname $0` # # Canonicalize relative paths to absolute paths # pushd $path \> /dev/null dir=`pwd` path=$dir popd \> /dev/null # Fetch the Android SDK path from the first command line argument. # If not provided from the command line, then attempt to fetch it from environment variable ANDROID\_SDK. SDK\_PATH= if [! -z "$1"] then SDK\_PATH=$1 else SDK\_PATH=$ANDROID\_SDK fi if [-z "$CORONA\_ENTERPRISE\_DIR"] then CORONA\_ENTERPRISE\_DIR=/Applications/CoronaEnterprise fi if [! -z "$2"] then CORONA\_PATH=$2 else CORONA\_PATH=$CORONA\_ENTERPRISE\_DIR fi RELATIVE\_PATH\_TOOL=$CORONA\_PATH/Corona/mac/bin/relativePath.sh CORONA\_PATH=`"$RELATIVE_PATH_TOOL" "$path" "$CORONA_PATH"` echo CORONA\_PATH: $CORONA\_PATH # Do not continue if we do not have the path to the Android SDK. if [-z "$SDK\_PATH"] then echo "" echo "USAGE: $script" echo "USAGE: $script android\_sdk\_path" echo "USAGE: $script android\_sdk\_path corona\_enterprise\_path" echo "\tandroid\_sdk\_path: Path to the root Android SDK directory." echo "\tcorona\_enterprise\_path: Path to the CoronaEnterprise directory." exit -1 fi # Before we can do a build, we must update all Android project directories to use the given Android SDK. # We do this by running the "android" command line tool. This will add a "local.properties" file to all # project directories that is required by the Ant build system to compile these projects for Android. "$SDK\_PATH/tools/android" update project -p . checkError "$SDK\_PATH/tools/android" update lib-project -p "$CORONA\_PATH/Corona/android/lib/Corona" checkError echo "Using Corona Enterprise Dir: $CORONA\_PATH" # Build the Test project via the Ant build system. ant debug -D"CoronaEnterpriseDir"="$CORONA\_PATH" checkError
build.xml:
\<?xml version="1.0" encoding="UTF-8"?\> \<project name="Unscramble Anagram" default="help"\> \<!-- The local.properties file is created and updated by the 'android' tool. It contains the path to the SDK. It should \*NOT\* be checked into Version Control Systems. --\> \<property file="local.properties" /\> \<!-- The ant.properties file can be created by you. It is only edited by the 'android' tool to add properties to it. This is the place to change some Ant specific build properties. Here are some properties you may want to change/update: source.dir The name of the source directory. Default is 'src'. out.dir The name of the output directory. Default is 'bin'. For other overridable properties, look at the beginning of the rules files in the SDK, at tools/ant/build.xml Properties related to the SDK location or the project target should be updated using the 'android' tool with the 'update' action. This file is an integral part of the build system for your application and should be checked into Version Control Systems. --\> \<property file="ant.properties" /\> \<!-- The project.properties file is created and updated by the 'android' tool, as well as ADT. This contains project specific properties such as project target, and library dependencies. Lower level build properties are stored in ant.properties (or in .classpath for Eclipse projects). This file is an integral part of the build system for your application and should be checked into Version Control Systems. --\> \<loadproperties srcFile="project.properties" /\> \<!-- quick check on sdk.dir --\> \<fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" unless="sdk.dir" /\> \<!-- Import per project custom build rules if present at the root of the project. This is the place to put custom intermediary targets such as: -pre-build -pre-compile -post-compile (This is typically used for code obfuscation. Compiled code location: ${out.classes.absolute.dir} If this is not done in place, override ${out.dex.input.absolute.dir}) -post-package -post-build -pre-clean --\> \<import file="custom\_rules.xml" optional="true" /\> \<!-- Import the actual build file. To customize existing targets, there are two options: - Customize only one target: - copy/paste the target into this file, \*before\* the \<import\> task. - customize it to your needs. - Customize the whole content of build.xml - copy/paste the content of the rules files (minus the top node) into this file, replacing the \<import\> task. - customize to your needs. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\*\*\*\*\* IMPORTANT \*\*\*\*\*\* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* In all cases you must update the value of version-tag below to read 'custom' instead of an integer, in order to avoid having your file be overridden by tools such as "android update project" --\> \<!-- version-tag: custom --\> \<import file="${sdk.dir}/tools/ant/build.xml" /\> \<!-- Run the "Corona Builder" in the pre-build step. --\> \<target name="-pre-build"\> \<mkdir dir="${basedir}/assets" /\> \<exec executable="${CoronaEnterpriseDir}/Corona/mac/bin/lua" failonerror="true"\> \<arg value="-e" /\> \<arg value="package.path='${CoronaEnterpriseDir}/Corona/shared/bin/?.lua;${CoronaEnterpriseDir}/Corona/shared/bin/?/init.lua;'..package.path" /\> \<arg value="${CoronaEnterpriseDir}/Corona/shared/bin/Compile.lua" /\> \<arg value="mac" /\> \<arg value="${CoronaEnterpriseDir}" /\> \<env key="LUA\_CPATH" value="${CoronaEnterpriseDir}/Corona/mac/bin/?.so"/\> \<env key="TARGET\_PLATFORM" value="android"/\> \<env key="PROJECT\_DIR" value="${basedir}"/\> \<env key="CORONA\_COPY\_PNG\_PRESERVE" value="--preserve"/\> \<env key="CONFIGURATION" value="${ant.project.invoked-targets}"/\> \<env key="CORONA\_ASSETS\_DIR" value="${basedir}/../Corona"/\> \<env key="CORONA\_TARGET\_RESOURCES\_DIR" value="${basedir}/assets"/\> \<env key="CORONA\_TARGET\_EXECUTABLE\_DIR" value="${basedir}/assets"/\> \</exec\> \</target\> \<!-- This certifies the built APK before digitally signing it. --\> \<target name="-post-package"\> \<exec executable="${CoronaEnterpriseDir}/Corona/mac/bin/CertifyBuild.sh" failonerror="true"\> \<env key="CORONA\_APK\_PATH" value="${out.packaged.file}"/\> \<env key="CORONA\_RESOURCE\_CAR\_PATH" value="${basedir}/assets"/\> \</exec\> \</target\> \</project\>
I also have the ant.properties file created with my keystore info entered in.
Create a file called: secure.properties in your folder. To it add these two lines:
key.store.password=yourkeystorepassword
key.alias.password=youraliaspassword
Now you’re putting this in a clear text file which isn’t the most secure thing to do, but if you’re the only one on your computer and you don’t allow people to access your hard drive remotely, it shouldn’t be a problem.
Then add this: <property file=“secure.properties” />
to your build.xml right after the <project name=“blahblahblah”> line.
Rob
I just want to reiterate that this is STILL a problem. The sample build.xml specified for debug builds will successfully build the apk, but the apk WILL NOT install on the device and errors out with:
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Is it even possible to have a debug build of a corona enterprise app? If it is possible, why are the samples provided by Corona wrong? Very frustrating…
I noticed in one of your responses that you mentioned you can modify the build.xml file to produce a debug apk but that it will not be signed. Is there a way to further modify it so that it is automatically signed with the android sdk debug store?
For debug builds, what I did was create a “build_debug.sh” script beside the build.sh script changing the “ant” line near the end:
ant debug -D"CoronaEnterpriseDir"="$CORONA_PATH"
Change the release to debug.
It should produce a bin/yourapp-debug.apk file that you can install.
Rob
Hi rob,
Thanks for your reply. I have done just that. It produces a debug apk, but when you try to install it, you will get the error as described:
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
That is why I was saying the sample build files for debug are broken
I’m checking with Engineering. This should be working.
Hi Rob,
Any word back?
Thanks
Not yet.