As seen from the result of "jarsigner -verify" my apk is indeed signed, and I still get install "Failure". Any help would be great !
carl-emil#carlemil-ThinkPad-T410:~/workspace/myapp$ ~/android-sdk-linux_15/platform-tools/adb install target/myapp-aligned.apk
3857 KB/s (352413 bytes in 0.089s)
pkg: /data/local/tmp/myapp-aligned.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
carl-emil#carlemil-ThinkPad-T410:~/workspace/OVIVO$ jarsigner -verify target/myapp-aligned.apk
jar verified.
carl-emil#carlemil-ThinkPad-T410:~/workspace/myapp$ java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.2)
OpenJDK Server VM (build 20.0-b11, mixed mode)
carl-emil#carlemil-ThinkPad-T410:~/workspace/myapp$
I'm building this project with maven3, the log from maven can be seen below, can't find anything in it that should result in a broken signing step.
carl-emil#carlemil-ThinkPad-T410:~/workspace/myapp$ mvn3 clean install -Pmyapp,monkey
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.goldengekko.myapp.selfcare:myapp-selfcare:apk:1.11-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-resources-plugin is missing. # line 166, column 12
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. # line 213, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.goldengekko.myapp.selfcare:myapp-selfcare 1.11-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.goldengekko.com:8001/nexus/content/groups/public/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml
Downloaded: http://maven........maven-metadata.xml (704 B at 0.5 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # myapp-selfcare ---
[INFO] Deleting /home/carl-emil/workspace/myapp/target
[INFO]
[INFO] --- build-helper-maven-plugin:1.5:parse-version (parse-version) # myapp-selfcare ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default) # myapp-selfcare ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 62 resources to res
[INFO] Copying 1 resource to res
[INFO] Copying 1 resource to res/values/
[INFO] Copying 1 resource to /home/carl-emil/workspace/myapp/target/filtered-manifest
[INFO]
[INFO] --- android-maven-plugin:3.1.1:generate-sources (default-generate-sources) # myapp-selfcare ---
[DEBUG] Expanding: /home/carl-emil/.m2/repository/com/viewpagerindicator/library/2.2.3/library-2.2.3.apklib into /home/carl-emil/workspace/myapp/target/unpack/apklibs/com.viewpagerindicator_library_apklib_2.2.3
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] /home/carl-emil/android-sdk-linux_15/platform-tools/aapt [package, -m, -J, /home/carl-emil/workspace/myapp/target/generated-sources/r, -M, /home/carl-emil/workspace/myapp/target/filtered-manifest/AndroidManifest.xml, -S, /home/carl-emil/workspace/myapp/res, -S, /home/carl-emil/workspace/myapp/target/unpack/apklibs/com.viewpagerindicator_library_apklib_2.2.3/res, --auto-add-overlay, -A, /home/carl-emil/workspace/myapp/assets, -I, /home/carl-emil/android-sdk-linux_15/platforms/android-8/android.jar]
[INFO] /home/carl-emil/android-sdk-linux_15/platform-tools/aapt [package, -m, -J, /home/carl-emil/workspace/myapp/target/generated-sources/r, --custom-package, com.viewpagerindicator, -M, /home/carl-emil/workspace/myapp/target/filtered-manifest/AndroidManifest.xml, -S, /home/carl-emil/workspace/myapp/res, -S, /home/carl-emil/workspace/myapp/target/unpack/apklibs/com.viewpagerindicator_library_apklib_2.2.3/res, --auto-add-overlay, -A, /home/carl-emil/workspace/myapp/assets, -A, /home/carl-emil/workspace/myapp/target/unpack/apklibs/com.viewpagerindicator_library_apklib_2.2.3/assets, -I, /home/carl-emil/android-sdk-linux_15/platforms/android-8/android.jar]
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # myapp-selfcare ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 62 resources to res
[INFO] Copying 1 resource to res
[INFO] Copying 1 resource to res/values/
[INFO] Copying 1 resource to /home/carl-emil/workspace/myapp/target/filtered-manifest
[INFO] skip non existing resourceDirectory /home/carl-emil/workspace/myapp/target/generated-sources/extracted-dependencies/src/main/resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # myapp-selfcare ---
[INFO] Compiling 36 source files to /home/carl-emil/workspace/myapp/target/classes
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (FixManifest) # myapp-selfcare ---
[INFO] Executing tasks
main:
inotify_add_watch: No such file or directory
[INFO] Executed tasks
[INFO]
[INFO] registerToSubTree : warning, failed to register /home/carl-emil/workspace/myapp/target/filtered-manifest/rep2865681923253179562.tmp :Error watching /home/carl-emil/workspace/myapp/target/filtered-manifest/rep2865681923253179562.tmp : No such file or directory--- android-maven-plugin:3.1.1:proguard (default-proguard) # myapp-selfcare ---
inotify_add_watch: No such file or directory
registerToSubTree : warning, failed to register /home/carl-emil/workspace/myapp/target/filtered-manifest/rep244121430022461645.tmp :Error watching /home/carl-emil/workspace/myapp/target/filtered-manifest/rep244121430022461645.tmp : No such file or directory
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # myapp-selfcare ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/carl-emil/workspace/myapp/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # myapp-selfcare ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12:test (default-test) # myapp-selfcare ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/carl-emil/workspace/myapp/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- android-maven-plugin:3.1.1:dex (default-dex) # myapp-selfcare ---
[INFO] /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java [-Xmx1024M, -jar, /home/carl-emil/android-sdk-linux_15/platform-tools/lib/dx.jar, --dex, --output=/home/carl-emil/workspace/myapp/target/classes.dex, /home/carl-emil/.m2/repository/com/viewpagerindicator/library/2.2.3/library-2.2.3.apklib, /home/carl-emil/.m2/repository/android/support.v4/0.0.6/support.v4-0.0.6.jar, /home/carl-emil/.m2/repository/com/googlecode/androidannotations/androidannotations/2.4/androidannotations-2.4-api.jar, /home/carl-emil/workspace/myapp/target/classes, /home/carl-emil/.m2/repository/com/directionalviewpager/library/1.2.0/library-1.2.0.jar, /home/carl-emil/.m2/repository/com/google/code/gson/gson/1.6/gson-1.6.jar, /home/carl-emil/.m2/repository/com/sun/codemodel/codemodel/2.4.1/codemodel-2.4.1.jar]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # myapp-selfcare ---
[INFO] Building jar: /home/carl-emil/workspace/myapp/target/myapp-selfcare.jar
[INFO]
[INFO] --- android-maven-plugin:3.1.1:apk (default-apk) # myapp-selfcare ---
[INFO] Copying dependency assets files to combined assets directory.
[INFO] Copying local assets files to combined assets directory.
[INFO] /home/carl-emil/android-sdk-linux_15/platform-tools/aapt [package, -f, -M, /home/carl-emil/workspace/myapp/target/filtered-manifest/AndroidManifest.xml, -S, /home/carl-emil/workspace/myapp/res, -S, /home/carl-emil/workspace/myapp/target/unpack/apklibs/com.viewpagerindicator_library_apklib_2.2.3/res, --auto-add-overlay, -A, /home/carl-emil/workspace/myapp/target/generated-sources/combined-assets/assets, -I, /home/carl-emil/android-sdk-linux_15/platforms/android-8/android.jar, -F, /home/carl-emil/workspace/myapp/target/myapp-selfcare.ap_]
[INFO]
[INFO] --- maven-jarsigner-plugin:1.2:sign (signing) # myapp-selfcare ---
[INFO] 2 archive(s) processed
[INFO]
[INFO] --- android-maven-plugin:3.1.1:zipalign (alignApk) # myapp-selfcare ---
[INFO] Running command: /home/carl-emil/android-sdk-linux_15/tools/zipalign
[INFO] with parameters: [-f, 4, /home/carl-emil/workspace/myapp/target/myapp-selfcare.apk, /home/carl-emil/workspace/myapp/target/myapp-selfcare-aligned.apk]
[INFO] Attach /home/carl-emil/workspace/myapp/target/myapp-selfcare-aligned.apk to the project
[INFO]
[INFO] --- android-maven-plugin:3.1.1:internal-pre-integration-test (default-internal-pre-integration-test) # myapp-selfcare ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO]
[INFO] --- android-maven-plugin:3.1.1:internal-integration-test (default-internal-integration-test) # myapp-selfcare ---
[INFO] No InstrumentationRunner found - skipping tests
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # myapp-selfcare ---
JNotifyAdapterLinux: warning, recieved event for an unregisted LinuxWD -1 ignoring...
JNotifyAdapterLinux: warning, recieved event for an unregisted LinuxWD -1 ignoring...
JNotifyAdapterLinux: warning, recieved event for an unregisted LinuxWD -1 ignoring...
[INFO] Installing /home/carl-emil/workspace/myapp/target/myapp-selfcare.apk to /home/carl-emil/.m2/repository/com/goldengekko/myapp/selfcare/myapp-selfcare/1.11-SNAPSHOT/myapp-selfcare-1.11-SNAPSHOT.apk
[INFO] Installing /home/carl-emil/workspace/myapp/pom.xml to /home/carl-emil/.m2/repository/com/goldengekko/myapp/selfcare/myapp-selfcare/1.11-SNAPSHOT/myapp-selfcare-1.11-SNAPSHOT.pom
[INFO] Installing /home/carl-emil/workspace/myapp/target/myapp-selfcare.jar to /home/carl-emil/.m2/repository/com/goldengekko/myapp/selfcare/myapp-selfcare/1.11-SNAPSHOT/myapp-selfcare-1.11-SNAPSHOT.jar
[INFO] Installing /home/carl-emil/workspace/myapp/target/myapp-selfcare-aligned.apk to /home/carl-emil/.m2/repository/com/goldengekko/myapp/selfcare/myapp-selfcare/1.11-SNAPSHOT/myapp-selfcare-1.11-SNAPSHOT-aligned.apk
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.769s
[INFO] Finished at: Fri Mar 23 08:59:37 UTC 2012
[INFO] Final Memory: 13M/64M
[INFO] ------------------------------------------------------------------------
Found it! I was having this problem with 'ant' and it was due to this CAUTION mentioned in the documentation:
http://developer.android.com/guide/publishing/app-signing.html#signapp
Caution: As of JDK 7, the default signing algorithim has changed, requiring you to specify the signature and digest algorithims (-sigalg and -digestalg) when you sign an APK.
I have JDK 7. I can't speak for your OpenJDK IcedTea, but it is probably the same issue. Your Maven log didn't give enough details. In my Ant log, I used -v for verbose and it showed
$ ant -Dadb.device.arg=-d -v release install
[signjar] Executing 'C:\Program Files\Java\jdk1.7.0_03\bin\jarsigner.exe' with arguments:
[signjar] '-keystore'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\release.keystore'
[signjar] '-signedjar'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\bin\PairFinder-release-unaligned.apk'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\bin\PairFinder-release-unsigned.apk'
[signjar] 'mykey'
[exec] pkg: /data/local/tmp/PairFinder-release.apk
[exec] Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
I signed the JAR manually and zipaligned it, but it gave a slightly different error:
$ "$JAVA_HOME"/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore release.keystore -signedjar bin/PairFinder-release-unaligned.apk bin/PairFinder-release-unsigned.apk mykey
$ zipalign -v -f 4 bin/PairFinder-release-unaligned.apk bin/PairFinder-release.apk
$ adb -d install -r bin/PairFinder-release.apk
pkg: /data/local/tmp/PairFinder-release.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
641 KB/s (52620 bytes in 0.080s)
I found that answered here.
How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstallation
I only needed to uninstall it and then it worked!
$ adb -d uninstall com.kizbit.pairfinder
Success
$ adb -d install -r bin/PairFinder-release.apk
pkg: /data/local/tmp/PairFinder-release.apk
Success
641 KB/s (52620 bytes in 0.080s)
Now I only need modify the build.xml to use those options when signing!
Ok here it is: C:\Program Files\Java\android-sdk\tools\ant\build.xml
<signjar
sigalg="MD5withRSA"
digestalg="SHA1"
jar="${out.packaged.file}"
signedjar="${out.unaligned.file}"
keystore="${key.store}"
storepass="${key.store.password}"
alias="${key.alias}"
keypass="${key.alias.password}"
verbose="${verbose}" />
As suggested here use at least Ant 1.8.3 and put this snippet to your ant file:
<presetdef name="signjar">
<signjar sigalg="MD5withRSA" digestalg="SHA1" />
</presetdef>
I build the application using debug[microsoft.net] configuration in MonoDevelop. Now it works fine.
In my case, I could build and run release builds, but got the INSTALL_PARSE_FAILED_NO_CERTIFICATES error when trying to do a debug build.
The solution was to delete my debug.keystore file and let the build system recreate it.
For others experiencing similar problems - I had the same error, but it didn't seem to be the signing algorithm. I just had to use jarsigner from Java 1.6. The signing algorithms I used appear to be the same for both: dsaWithSHA1, but 1.6 worked and 1.7 didn't.
Related
Any idea how to fix this ?
with master branch:
> android:test
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn] android:installLocation="auto">
[warn] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] Packaging resources: resources-debug.ap_
[warn] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[info] Finding dependency references for: classes.jar
ProGuard, version 5.0
ProGuard is released under the GNU General Public License. You therefore
must ensure that programs that link to it (android, ...)
carry the GNU General Public License as well. Alternatively, you can
apply for an exception with the author of ProGuard.
Reading input...
Reading program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
Reading program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
Reading library jar [/Users/joco/Library/Android/sdk/platforms/android-17/android.jar]
Initializing...
Ignoring unused library classes...
Original number of library classes: 3259
Final number of library classes: 429
Shrinking...
Removing unused program classes and class elements...
Original number of program classes: 3896
Final number of program classes: 589
Writing output...
Preparing output jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/proguard/classes.proguard.jar]
Copying resources from program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
Copying resources from program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
[info] Creating proguard cache: proguard-cache-bc48b41614facee8c23102b3a1a44318045dcb99.jar
[info] Generating dex, incremental=false, multidex=false
[info] dex method count: 4260
[info] Packaged: hello-world-debug-unaligned.apk (150.65KB)
[info] Debug package does not need signing: hello-world-debug-unaligned.apk
[info] zipaligned: hello-world-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [hello-world-debug.apk] Install finished: 150.65KB in 1.02s. 148.42KB/s
[info] Testing on Android SDK built for x86_64 (emulator-5554)...
[success] Total time: 10 s, completed Aug 7, 2016 9:47:03 PM
> android:run
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn] android:installLocation="auto">
[warn] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] [debug] cache hit, skipping proguard!
[info] Generating dex, incremental=false, multidex=false
[info] dex method count: 4515
[info] Packaged: hello-world-debug-unaligned.apk (169.32KB)
[info] Debug package does not need signing: hello-world-debug-unaligned.apk
[info] zipaligned: hello-world-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [hello-world-debug.apk] Install finished: 169.32KB in 1.10s. 153.37KB/s
[error] No activity found with action 'android.intent.action.MAIN'
[error] (android:run) No activity found with action 'android.intent.action.MAIN'
[error] Total time: 4 s, completed Aug 7, 2016 9:48:05 PM
> pwd
[error] Not a valid command: pwd (similar: pidcat, append)
[error] Not a valid project ID: pwd
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: pwd (similar: dex, doc, update)
[error] pwd
[error] ^
> exit
bash-3.2$ pwd
/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout
bash-3.2$ sbt
[info] Loading global plugins from /Users/joco/.sbt/0.13/plugins
[info] Set current project to hello-world (in build file:/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/)
> android:package-rel
{invalid input}
> android:package-relea
{invalid input}
> android:package-release
[info] Compiling 3 Scala sources and 2 Java sources to /Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes...
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn] android:installLocation="auto">
[warn] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] Packaging resources: resources-release.ap_
[info] Packaging /Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar ...
[info] Done packaging.
ProGuard, version 5.0
ProGuard is released under the GNU General Public License. You therefore
must ensure that programs that link to it (android, ...)
carry the GNU General Public License as well. Alternatively, you can
apply for an exception with the author of ProGuard.
Reading input...
Reading program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
Reading program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
Reading library jar [/Users/joco/Library/Android/sdk/platforms/android-17/android.jar]
Initializing...
Ignoring unused library classes...
Original number of library classes: 3259
Final number of library classes: 429
Shrinking...
Removing unused program classes and class elements...
Original number of program classes: 3896
Final number of program classes: 589
Writing output...
Preparing output jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/proguard/classes.proguard.jar]
Copying resources from program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
Copying resources from program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
[info] Generating dex, incremental=false, multidex=false
[info] dex method count: 4260
[info] Packaged: hello-world-release-unsigned.apk (149.21KB)
[warn] Package needs signing: hello-world-release-unsigned.apk
[warn] Package needs signing and zipaligning: hello-world-release-unsigned.apk
[success] Total time: 14 s, completed Aug 7, 2016 9:51:46 PM
> android:run
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn] android:installLocation="auto">
[warn] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] classes.proguard.jar is up-to-date
[info] Packaged: hello-world-release-unsigned.apk (149.21KB)
[warn] Package needs signing: hello-world-release-unsigned.apk
[warn] Package needs signing and zipaligning: hello-world-release-unsigned.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[error] Install failed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
[error] (android:install) Install failed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
[error] Total time: 2 s, completed Aug 7, 2016 9:51:58 PM
with 1.6.10 version : http://lpaste.net/174900
EDIT:
Added key info to local.properties ( as suggested in point 8 here), now I get:
> android:run
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn] android:installLocation="auto">
[warn] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] [debug] cache hit, skipping proguard!
[info] Packaged: hello-world-debug-unaligned.apk (27.52KB)
[info] Debug package does not need signing: hello-world-debug-unaligned.apk
[info] zipaligned: hello-world-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [hello-world-debug.apk] Install finished: 27.52KB in 0.89s. 30.99KB/s
[error] No activity found with action 'android.intent.action.MAIN'
[error] (android:run) No activity found with action 'android.intent.action.MAIN'
[error] Total time: 1 s, completed Aug 7, 2016 10:22:11 PM
What might be the problem ?
I've tried to create an MQTT project on Android by using PAHO.
According to the description, I clone the source code to my computer, and using
mvn clean install
to build the project.
I download org.eclipse.paho.mqtt.java-1.0.0, and expecting to get:
org.eclipse.paho.client.mqttv3-1.0.0.jar and
org.eclipse.paho.android.service-1.0.0.jar
but after running mvn clean install, I just can get org.eclipse.paho.client.mqttv3-1.0.0.jar, so I can't build the project.
and here is the message output:
C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.and roid.service>mvn install -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model fororg.eclipse.paho:android-service:jar:0.1
[WARNING] 'version' contains an expression but should be a constant. # org.eclipse.paho:java-parent:${paho.version}, C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\pom.xml, line 7, column 11
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # line 95, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building android-service 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- templating-maven-plugin:1.0-alpha-3:filter-sources (filter-src) # android-service ---
[INFO] Request to add 'C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\src\main\java-templates' folder. Not added since it does not exist.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # android-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) # android-service ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (generate-manifest) # android-service ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.910 s
[INFO] Finished at: 2015-01-15T13:16:59+08:00
[INFO] Final Memory: 13M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:manifest (generate-manifest) on project android-service: Cannot find C:\Users\Janniin\
Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must be run after compile phase) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:manifest (generate-manifest) on projec
t android-service: Cannot find C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must b
e run after compile phase)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot find C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must be run after compile phase)
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:73)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:264)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.FileNotFoundException: C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes
at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer(ManifestPlugin.java:175)
at org.apache.felix.bundleplugin.ManifestPlugin.getManifest(ManifestPlugin.java:114)
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:69)
... 23 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Could anyone give me some suggest to solve this problem??
Thx a lot!!
Have you tried following the information described here https://eclipse.org/paho/clients/java/ in order to build from source.
After running mvn package -DskipTests (it took some time) I got:
org.eclipse.paho.android.service-1.0.1.jar which is located under ..\org.eclipse.paho.mqtt.java\org.eclipse.paho.android.service\org.eclipse.paho.android.service\target
org.eclipse.paho.client.mqttv3-1.0.1.jar which is located under ..\org.eclipse.paho.mqtt.java\org.eclipse.paho.client.mqttv3\target
I installed titanium studio on windows xp
When trying to launch an application "hello world" in the tablet (recognizing) titanium shows an error in evets, js
Looking online seems to be the problem of environment variables. However, I can not get it to work.
Someone can help me?
thanks
My path environment variables:
%CLASSPATH%;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Archivos de programa\Java\jdk1.7.0_01\bin;C:\apache-ant-1.7.1\bin;C:\Documents and Settings\gcid\Escritorio\eclipsePhonegapp\sdk\tools;C:\android-sdk\tools;C:\android-sdk\platform-tools;C:\Archivos de programa\Git\cmd;C:\Archivos de programa\nodejs\;C:\Archivos de programa\nodejs\node_modules\npm\bin;C:\Archivos de programa\Java\jdk1.6.0_45\bin;
The error:
Titanium Command-Line Interface, CLI version 3.2.1, Titanium SDK version 3.2.1.GA
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[INFO] : Found Titanium plugin id=ti.alloy version=1.0
[INFO] : Deploy type: test
[INFO] : Building for target: device
[INFO] : Building for device: C16903012641A2E
[INFO] : Targeting Android SDK: 16
[INFO] : Building for the following architectures: armeabi, armeabi-v7a, x86
[INFO] : Signing with keystore: C:\Documents and Settings\gcid\Datos de programa\Titanium\mobilesdk\win32\3.2.1.GA\android\dev_keystore (tidev)
[INFO] : Debugging disabled
[INFO] : Profiler disabled
[INFO] : Forcing rebuild: C:\Documents and Settings\gcid\Documents\Titanium_Studio_Workspace\pruebas\build\android\build-manifest.json does not exist
[INFO] : Found Alloy app in C:\Documents and Settings\gcid\Documents\Titanium_Studio_Workspace\pruebas\app
[INFO] : Executing Alloy compile: alloy.cmd compile C:\Documents and Settings\gcid\Documents\Titanium_Studio_Workspace\pruebas\app --config platform=android,version=0,simtype=none,devicefamily=none,deploytype=test
[INFO] : ----- MVC GENERATION -----
[INFO] : [global style] loading from cache...
[INFO] : [index.xml] view processing...
[INFO] : style: "index.tss"
[INFO] : view: "index.xml"
[INFO] : controller: "index.js"
[INFO] : created: "Resources\android\alloy\controllers\index.js"
[INFO] : created: "Resources\android\alloy\styles\index.js"
[INFO] :
[INFO] : [app.js] using cached app.js...
[INFO] :
[INFO] : ----- OPTIMIZING -----
[INFO] : - android\alloy.js
[INFO] : - android\alloy\sync\localStorage.js
[INFO] : - android\alloy\sync\properties.js
[INFO] : - android\alloy\sync\sql.js
[INFO] :
[INFO] : Alloy compiled in 0.51163s
[INFO] : Alloy compiler completed successfully
[INFO] : Processing JavaScript files
[INFO] : Encrypting JavaScript files: C:\Documents and Settings\gcid\Datos de programa\Titanium\mobilesdk\win32\3.2.1.GA\android\titanium_prep.win32.exe "com.bilbomatica.pruebas" "C:\Documents and Settings\gcid\Documents\Titanium_Studio_Workspace\pruebas\build\android\assets" "app.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage.js" "alloy/sync/properties.js" "alloy/sync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json"
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn Unknown system errno 193
at errnoException (child_process.js:980:11)
at ChildProcess._handle.onexit (child_process.js:771:34)
[ERROR] Application Installer abnormal process termination. Process exit value was 8
I have create a simple alloy project using titanium studio. by File--> New ---> mobile project-->Defultalloy projects.
Then i tried to run on device oremulator.
getting the error like this.
Titanium Command-Line Interface, CLI version 3.1.2, Titanium SDK version 3.1.3.GA
Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.
[INFO] : Found Alloy app in E:\Mopl_WorkSpace\2013\titanium\WORKSP1\testAlloy\app
[INFO] : Executing Alloy compile: alloy.cmd compile E:\Mopl_WorkSpace\2013\titanium\WORKSP1\testAlloy\app --config platform=android,version=0,simtype=none,devicefamily=none,deploytype=test
[INFO] : ----- MVC GENERATION -----
[INFO] : [index.xml] view processing...
[INFO] : style: "index.tss"
[INFO] : view: "index.xml"
[INFO] : controller: "index.js"
[INFO] : created: "Resources\alloy\controllers\index.js"
[INFO] : created: "Resources\alloy\styles\index.js"
[INFO] :
[INFO] : [app.js] Titanium entry point processing...
[INFO] : created: "Resources\app.js"
[INFO] :
[INFO] : ----- OPTIMIZING -----
[INFO] : - alloy.js
[INFO] : - alloy\backbone.js
[INFO] : - alloy\constants.js
[INFO] : - alloy\underscore.js
[INFO] : - alloy\widget.js
[INFO] : - alloy\controllers\BaseController.js
[INFO] : - alloy\controllers\index.js
[INFO] : - alloy\styles\index.js
[INFO] : - alloy\sync\localStorage.js
[INFO] : - alloy\sync\properties.js
[INFO] : - alloy\sync\sql.js
[INFO] : - alloy\sync\util.js
[INFO] : - android\alloy\CFG.js
[INFO] :
[INFO] : Alloy compiled in 0.97891s
[INFO] : Alloy compiler completed successfully
[INFO] : Running build process: python "D:\Software\android-sdk-windows\mobilesdk\win32\3.1.3.GA\android\builder.py" "install" "testAlloy" "D:\Software\android-sdk-windows" "E:\Mopl_WorkSpace\2013\titanium\WORKSP1\testAlloy" "com.t.j" "16"
File "D:\Software\android-sdk-windows\mobilesdk\win32\3.1.3.GA\android\builder.py", line 141
print "[DEBUG] Signal %s received. Terminating the logcat process." % signum
^
SyntaxError: invalid syntax
[ERROR] : Build process exited with code 1
At the end of a maven mvn clean install run, the created artifacts are automatically installed in the repository by the maven-install-plugin:
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # project ---
[INFO] Installing C:\Users\mannaz\workspace\project\target\project-0.1.1-test.apk to C:\Users\mannaz\.m2\repository\at\mannaz\android\project\0.1.1\project-0.1.1.apk
[INFO] Installing C:\Users\mannaz\workspace\project\pom.xml to C:\Users\mannaz\.m2\repository\at\mannaz\android\project\0.1.1\project-0.1.1.pom
[INFO] Installing C:\Users\mannaz\workspace\project\target\project-0.1.1-test.jar to C:\Users\mannaz\.m2\repository\at\mannaz\android\project\0.1.1\project-0.1.1.jar
Unfortunately the final apk filename is renamed during this process (project-0.1.1-test.apk>>project-0.1.1.apk).
Initially the name of the apk file is set via
<finalName>${project.artifactId}-${project.version}-${webservice.target}</finalName>
How can I specify the final name of the apk file in the build archive without overriding the <version/> attribute itself?
Reason:
Running mvn clean install -X cause Maven execute default-install goal at the end of the build life cycle, which use the default groupId:artifactId:packaging:version install the generated apk (I use abc-123 as the final name in this example):
[INFO] --- maven-install-plugin:2.1:install (default-install) # myapp ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader#11b86e7]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.1:install' with basic configurator -->
[DEBUG] (f) artifact = com.mycompany:myapp:apk:1.2.2-SNAPSHOT
[DEBUG] (f) attachedArtifacts = [com.mycompany:myapp:jar:1.2.2-SNAPSHOT]
[DEBUG] ... ...
[DEBUG] -- end configuration --
[INFO] Installing C:\workspace\myapp\target\abc-123.apk to c:\maven\repository\com\mycompany\myapp\1.2.2-SNAPSHOT\myapp-1.2.2-SNAPSHOT.apk
[INFO] ... ...
Solution:
This default artifact install is AFAIK neither avoidable nor modifiable, and the <finalName> doesn't take any effect on the target file name (which use a fixed pattern artifactId-version-classifier.packaging) during the default-install goal execution. The solution is attach extra artifact to the build life cycle, depend on you demand (If you only need add some suffix behind myapp-1.2.2-SNAPSHOT), the easiest way is define a classifier in android-maven-plugin configuration:
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<classifier>test</classifier>
... ...
</configuration>
</plugin>
This will cause both myapp-1.2.2-SNAPSHOT.apk and myapp-1.2.2-SNAPSHOT-test.apk get installed into maven repository:
[INFO] --- maven-install-plugin:2.1:install (default-install) # myapp ---
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-install-plugin:2.1:install from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader#11b86e7]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-install-plugin:2.1:install' with basic configurator -->
[DEBUG] (f) artifact = com.mycompany:myapp:apk:1.2.2-SNAPSHOT
[DEBUG] (f) attachedArtifacts = [com.mycompany:myapp:jar:1.2.2-SNAPSHOT, com.mycompany:myapp:apk:test:1.2.2-SNAPSHOT]
[DEBUG] ... ...
[DEBUG] -- end configuration --
[INFO] Installing C:\workspace\myapp\target\abc-123.jar to c:\maven\repository\com\mycompany\myapp\1.2.2-SNAPSHOT\myapp-1.2.2-SNAPSHOT.apk
[INFO] ... ...
[INFO] Installing C:\workspace\myapp\target\abc-123.apk to c:\maven\repository\com\mycompany\myapp\1.2.2-SNAPSHOT\myapp-1.2.2-SNAPSHOT-test.apk