Fail to use Maven to build Paho project on Win7 - android

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

Related

sbt-android simple example fails with " [error] No activity found with action 'android.intent.action.MAIN'"

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 ?

android-sdk-plugin project doesn't know about Android classes

I have Ubuntu 15.04 64 bit, Scala 2.11.6 and sbt 0.13.8.
I have android-sdk installed with at least android-22, and ANDROID_HOME set properly.
I followed the "Usage" section in android-sdk-plugin and did the following:
Created a fresh directory with the following files:
build.sbt:
lazy val root = (project in file (".")).
settings(
name := "Test",
version := "0.0.1",
scalaVersion := "2.11.6"
)
project/plugins.sbt:
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.4.1")
project/build.scala:
object Build extends android.AutoBuild
Ran sbt and got the following output:
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
[info] Loading global plugins from /home/pcn/.sbt/0.13/plugins
[info] Loading project definition from /home/pcn/Code/practice/test-scala-android/project
[info] Updating {file:/home/pcn/Code/practice/test-scala-android/project/}test-scala-android-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to /home/pcn/Code/practice/test-scala-android/project/target/scala-2.10/sbt-0.13/classes...
[info] Set current project to Test (in build file:/home/pcn/Code/practice/test-scala-android/)
>
From sbt's promt, typed gen-android android-22 com.pcn.android.test Test and got the following output:
[info] Creating project: Test
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Error: Project folder '.' is not empty. Please consider using 'android update' instead.
Created directory /home/pcn/Code/practice/test-scala-android/src/main/java
Created directory /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test
Added file ./src/main/java/com/pcn/android/test/MainActivity.java
Created directory /home/pcn/Code/practice/test-scala-android/src/androidTest/java
Created directory /home/pcn/Code/practice/test-scala-android/src/androidTest/java/com/pcn/android/test
Added file ./src/androidTest/java/com/pcn/android/test/MainActivityTest.java
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res/values
Added file ./src/main/res/values/strings.xml
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res/layout
Added file ./src/main/res/layout/main.xml
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res/drawable-xhdpi
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res/drawable-hdpi
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res/drawable-mdpi
Created directory /home/pcn/Code/practice/test-scala-android/src/main/res/drawable-ldpi
Added file ./src/main/AndroidManifest.xml
Added file ./build.gradle
Created directory /home/pcn/Code/practice/test-scala-android/gradle/wrapper
[info] Creating SBT project files
>
From sbt's prompt, typed compile and got the following output:
[info] Updating {file:/home/pcn/Code/practice/test-scala-android/}root...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 1 Java source to /home/pcn/Code/practice/test-scala-android/target/scala-2.11/classes...
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:3: package android.app does not exist
[error] android.app.Activity
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:4: package android.os does not exist
[error] android.os.Bundle
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:6: cannot find symbol
[error] symbol: class Activity
[error] Activity
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:10: cannot find symbol
[error] symbol: class Bundle
[error] location: class com.pcn.android.test.MainActivity
[error] Bundle
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:9: method does not override or implement a method from a supertype
[error] #Override
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:12: cannot find symbol
[error] symbol: variable super
[error] location: class com.pcn.android.test.MainActivity
[error] super
[error] /home/pcn/Code/practice/test-scala-android/src/main/java/com/pcn/android/test/MainActivity.java:13: package R does not exist
[error] R.layout
[error] (compile:compileIncremental) javac returned nonzero exit code
[error] Total time: 0 s, completed Jun 19, 2015 1:18:50 AM
>
As we can see, for some reason it doesn't know about Activity and other Android classes. What did I do wrong and how do I fix it? I'm a complete noob with sbt so it's great if I can get detailed instructions.
Thanks.
PS: This is the content of my ~/.sbt/0.13/global.sbt, in case it's relevant:
scalacOptions ++= Seq("-deprecation", "-feature", "-optimize")
What you did in build.sbt confused AutoBuild. You can remove the project definition from build.sbt, or remove AutoBuild and apply androidBuild to the project manually.

Titanium studio display error events.js

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

Unable to build Android+Scala project using sbt+sbt-android plugin

I can't build Android + Scala (and IntelliJ Idea 12) project using sbt and sbt-android plugin. I installed everything needed and added ANDROID_SDK_HOME to both .bashrc and /etc/profile but:
me123#ubuntu:~/Documents/android_projects/my-android-project$ echo $ANDROID_SDK_HOME
/home/me123/android-sdk-linux/sdk
me123#ubuntu:~/Documents/android_projects/my-android-project$ sudo echo $ANDROID_SDK_HOME
/home/me123/android-sdk-linux/sdk
me123#ubuntu:~/Documents/android_projects/my-android-project$ sbt
[info] Loading global plugins from /home/me123/.sbt/plugins
[info] Loading project definition from /home/me123/Documents/android_projects/my-android-project/project
[info] Compiling 3 Scala sources to /home/me123/Documents/android_projects/my-android-project/project/target/scala-2.9.2/sbt-0.12/classes...
[error] /home/me123/Documents/android_projects/my-android-project/project/target/scala-2.9.2/sbt-0.12/classes/AndroidEclipse$Transformer.class (Permission denied)
[error] one error found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
me123#ubuntu:~/Documents/android_projects/my-android-project$ sudo sbt
[info] Loading project definition from /home/me123/Documents/android_projects/my-android-project/project
[info] Updating {file:/home/me123/Documents/android_projects/my-android-project/project/}default-6ff5da...
[info] Resolving org.scala-sbt#precompiled-2_10_0;0.12.2 ...
[info] Done updating.
[error] Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
UPDATE:
> android:start-device
[info] Wrote /home/alex/Documents/android_projects/my-android-project/target/scala-2.10/src_managed/main/scala/my/android/project/TR.scala
[info] Compiling 2 Scala sources and 1 Java source to /home/alex/Documents/android_projects/my-android-project/target/scala-2.10/classes...
[warn] there were 4 feature warnings; re-run with -feature for details
[warn] one warning found
ProGuard, version 4.6
ProGuard is released under the GNU General Public License. You therefore
must ensure that programs that link to it (scala, ...)
carry the GNU General Public License as well. Alternatively, you can
apply for an exception with the author of ProGuard.
Reading program directory [/home/alex/Documents/android_projects/my-android-project/target/scala-2.10/classes]
[trace] Stack trace suppressed: run last main/android:proguard for the full output.
[error] (main/android:proguard) java.io.IOException: Can't read [/home/alex/Documents/android_projects/my-android-project/target/scala-2.10/classes] (Can't process class [my/android/project/R$id.class] (Unsupported version number [51.0] for class format))
[error] Total time: 14 s, completed May 30, 2013 3:49:46 PM
First, doing sudo echo $ANDROID_HOME will be exactly the same as echo $ANDROID_HOME, because the variable will be replaced by your shell before executing the command.
Then, you most likely have a permission problem. Try running this to make sure you have the right ones :
$ chmod -Rv 700 /home/me123/Documents/android_projects/my-android-project/

Why does adb fail with Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]?

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.

Categories

Resources