Phonegap 3.3 cannot add platform - java

I have upgraded my Phonegap running on Windows 7 to the currently latest version to 3.3.0. I could create a project without any issue but when I try to add a platform say "android" an error occurs. Shown below is the error I get when I run "cordova platform add android" command on command promt on Windows 7. Please help.
E:\Dropbox\Development\Android\weatherlk>cordova platform add android
Creating android project...
C:\Users\Teshan\AppData\Roaming\npm\node_modules\cordova\node_modules\q\
throw e;
^
Error: An error occured during creation of android sub-project.
C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.
throw e;
^
Error: An error occurred while listing Android targets
at C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\lib\check_
at _rejected (C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin
at C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\node_modul
at Promise.when (C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\
at Promise.promise.promiseDispatch (C:\Users\Teshan\.cordova\lib\and
752:41)
at C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\node_modul
at flush (C:\Users\Teshan\.cordova\lib\android\cordova\3.3.0\bin\nod
at process._tickCallback (node.js:415:13)
at C:\Users\Teshan\AppData\Roaming\npm\node_modules\cordova\src\plat
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)

I had exactly this problem today. Turned out I had white space in the path variable for \android-sdk\tools (in windows 7 environment variables). Check the android batch file runs, ie type android in a command prompt in any directory, and also adb for the platform-tools path. A similar question is answered here < An error occured during creation of android sub-project >.

Here is a blog about installing it from start to finish with a little more detail than phonegap/cordova docs offer. A lot easier than piecing together the different stack questions: http://www.andrewsavory.com/blog/2013/2517

Related

JPackage getting ERROR: Unknown exception caught trying to find MSI installer

I'm getting the following error in JPackage using JDK-19 and JavaFX-19. Same configuration used to work using JDK-18 and JavaFX-16. It builds the install image, but is missing the msi installer.
Required environment variables:
PATH_TO_FX = C:\Java\javafx-19\sdk\lib
PATH_TO_FX_MODS = C:\Java\javafx-19\jmods
JPackage Version 19
[2022/11/12 10:46:54.801, jpackage.dll (PID: 5696, TID: 11192), jpackage.cpp:155 (Java_jdk_jpackage_internal_WinExeBundler_embedMSI)]
ERROR: Unknown exception caught
[10:45:03.636] Running candle.exe
[10:45:03.647] Running C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe
[10:45:03.784] Running light.exe
[10:45:03.788] Running C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe
[10:45:03.989] Detected [candle.exe] version [3.11.2.4516].
[10:45:03.989] Detected [light.exe] version [3.11.2.4516].
[10:45:03.990] WiX 3.11.2.4516 detected. Enabling advanced cleanup action.
Any guidance or where I might get help is much appreciated.
Thank you
Unfortunately, I needed to replace my boot drive, which involved reinstalling Windows and WIX Toolkit and Java plus all the other stuff. The error no longer occurs. I have no idea what fixed it, the new SSD is built the same as the old with the same versions of all software. There is not a software migration history on the new SSD as there was on the old HD. I'm using the same procedures as before.
I hate when we fix things and not know why, but such is life.

Android WireApp logs UnsatisfiedLink error: "wcall_set_video_send_state" when attempting video calls

I've built the wire app from the following repository:
https://github.com/wireapp/wire-android
Using the following build directions:
How to build locally Check out the wire-android repository. Switch to
latest relase branch release From the checkout folder, run ./gradlew
assembleProdRelease. This will pull in all the necessary dependencies
from Maven.
I've tried the release branch:
git clone https://github.com/wireapp/wire-android.git --branch release
And the master:
git clone https://github.com/wireapp/wire-android.git
Initially both versions gave the error:
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.UnsatisfiedLinkError: Error looking up function 'wcall_set_video_send_state': undefined symbol: wcall_set_video_send_state
at com.sun.jna.Function.<init>(Function.java:245)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:566)
However, this error can be solved by running the following command prior to opening the project in Android Studio:
gradlew assembleProdRelease
This command also creates the apks in build/output/apks. However, the build isn't signed with either the release or debug key. I used the following tool to sign the apk:
https://github.com/patrickfav/uber-apk-signer/releases
The APK is stable and runs fine, but still cannot initiate a video call. It gives the following errors:
Android 5:
08-24 22:53:29.877 296-881/? E/FastThread: did not receive expected
priority boost
Android 8:
08-24 23:10:02.190 406-4592/? E/AudioALSAPlaybackHandlerBase:
-getHardwareBufferInfo(), pcm_get_htimestamp fail, ret = -1, pcm_get_error =
Android 9 Emulator:
08-25 19:56:58.425 1583-3268/? W/audio_hw_generic: Not supplying
enough data to HAL, expected position 4108693 , only wrote 4108320
UPDATE:
I thought about trying to build my own versions of the AVS libraries: following https://github.com/wireapp/wire-audio-video-signaling
The following command needs to be run:
make dist_android
C:\work\wire-audio-video-signaling>make dist-android mk/target.mk:167:
*** Unknown host system. Stop.
mk/target.mk looks like:
# Start by auto-determining host system and arch.
ifeq ($(HOST_OS),)
HOST_UNAME := $(shell uname)
ifeq ($(HOST_UNAME),Darwin)
HOST_OS := osx
else
ifeq ($(HOST_UNAME),Linux)
HOST_OS := linux
else
$(error Unknown host system)
endif
endif
endif
The Makefile doesn't seem to be setup to support Windows so I'm going to try building it from a Linux machine to see if that helps.
UPDATE 2:
It does build better on Ubuntu, but it eventually dies complaining about compiler arguments. [Sorry I don't have the error to hand]
But I've managed to find binary copies of the library built for Android/ARM here:
http://dl.bintray.com/wire-android/releases/com/wire/avs/
However, these libraries do not seem to solve the issue either.
UPDATE 3:
Tried the following:
Downloaded the latest version of the .aar file from the link above
Renamed it to avs.aar
Installed in app/libs
Uncommented the line: "implementation (name:'avs', ext:'aar')"
But I got the error:
Program type already present: com.waz.avs.VideoCapturer$4
Message{kind=ERROR, text=Program type already present:
com.waz.avs.VideoCapturer$4, sources=[Unknown source file], tool
name=Optional.of(D8)}
There is a another reference to the AVS library below, if you comment that out the error will go away.
However, none of these steps solve the problem.
Now I will try to build older versions of the release branch...
Update 4: Release Branch: 2.41.359
[The most recent non-beta tagged release]
No longer compiles in Android studio because some of the XML files in the layout DIR are not well formed. Those must be fixed and checked into Git since the build process checks all the files out from Git.
The app initially runs normally and allows login, but always crashes after the edit devices screen. The app then crashes every time that you try to open it.
08-25 14:51:02.142 29066-29109/? E/AndroidRuntime: FATAL EXCEPTION:
Thread-4
Process: com.wire, PID: 29066
java.lang.NullPointerException: Attempt to invoke interface method 'int com.waz.call.RequestHandler.request$1d4ff469()' on a null object
reference
at com.waz.call.FlowManager.request(FlowManager.java:365)
Note: Seems that edit devices screen is not the cause of the problem because I removed all my devices in the web app but then 2.41.359 crashes on the phone without displaying the edit devices screen.
This issue is mentioned in following threads:
https://github.com/wireapp/wire-android/issues/1271
https://github.com/wireapp/wire-android/issues/1288
The advice seems to be to use the avslib.so file from the production version since the provided one is inadequate to run the project.
So I've dowloaded the APK off their website:
https://wire.com/en/download/
It is version: 3.15.634 [That's older than the one in the app store: 3.16.638 though hopefully that doesn't matter].
For anyone that doesn't know, an APK is just a ZIP file so I renamed it to from .apk to .zip for purposes of obtaining libavs.so:
Root Dir:
Libs Dir:
Arm Dir:
With libavs.so extracted, I renamed the unsigned version of wire-prod-release-2.41.99999 produced by the build tools to wire-prod-release-2.41.99999-avs-mod.zip and deleted the old libavs.so and replaced it with the one that I just took from the production version of the app. I renamed it back to .pkg then ran the following command to sign it:
java -jar \uber-apk-signer-0.8.4.jar --apks wire-prod-release-2.41.99999-avs-mod.apk -debug
Pretty good result, 2.41.359 no longer crashes. However, I still cannot initiate any audio or video calls. Same error found in the latest version of the release branch:
08-25 16:01:51.748 406-4592/? E/AudioALSAPlaybackHandlerBase: -getHardwareBufferInfo(), pcm_get_htimestamp fail, ret = -1, pcm_get_error =
As a sanity check, I installed the production version: 3.15.634 used to extra libavs.so and it is able to make both audio and video calls. [The version on GooglePlay: 3.16.638 also works fine for audio and video...]
Any ideas?
After a few days of trying, I found a way to build the project in such a way that it will initiate audio and video calls:
Procedure:
git clone https://github.com/wireapp/wire-android.git --branch release
cd wire-android
git checkout 2.40.357
Load the project into Android Studio
Edit the file res/layout/collection_file_asset.xml
Move <?xml version="1.0" encoding="utf-8"?> above the copyright comment since the file must begin with the XML tag
git add .
git commit -m "fixed syntax error"
gradlew assembleProdRelease
java -jar \uber-apk-signer-0.8.4.jar --apks wire-prod-release-2.40.99999.apk -debug
adb install wire-prod-release-2.40.99999-aligned-debugSigned.apk
Other Notes:
Master currently does not build due to Scala errors...
The current release branch produces a stable app but results in the following error when tapping on the video icon: "E/AudioALSAPlaybackHandlerBase: -getHardwareBufferInfo(), pcm_get_htimestamp fail, ret = -1, pcm_get_error ="
The most recent stable release 2.41.359 does not work because it crashes on every app launch with: "AndroidRuntime: FATAL EXCEPTION: Thread-4 Process: com.wire, PID: 29066 java.lang.NullPointerException: Attempt to invoke interface method 'int com.waz.call.RequestHandler.request$1d4ff469()' on a null object reference at com.waz.call.FlowManager.request(FlowManager.java:365)"
While building 2.40.357 enables audio and video, it is unstable and crashes quite a bit while receiving and making calls. I've spoken with other developers using this code base and they've encountered similar problems...
Thoughts:
I'm not really sure what's happening with this project. There are developers pleading for help with audio / video issues on Git with little response. I think I'd feel a little uneasy about using this code for a commercial project unless there is a bit more stability and support...
I gave up to compile a working application from source. Aside from educational reasons, my motivation to compile from source was a particular code change (lifting the limit of simultaneous accounts in the android app, as I have more than 2)
Doing that change itself is trivial, its just a constant defined in
app/src/main/scala/com/waz/zclient/pages/main/profile/preferences/pages/ProfileBottomSheetDialog.scala:
val MaxAccountsCount = 2
However, since no working application can be built from the provided sources - even with considerable effort - I instead used the smali/backsmali tool from
https://github.com/JesusFreke/smali
to create a patch/diff of this particular code change between a modified and unmodified (nonfunctional) binary app built from source - reflecting the corresponding changes in bytecode. (Although apktool could probably be used to do the same)
This bytecode patch can then be applied to the precompiled and fully functional production app as well, also using smali/backsmali (or apktool)

Android app with Oracle MAF, build.xml not found

I'm currently developing an Android (API 21) app on Eclipse OEPE (Mars) using a 64-bit Win7. The SDK was downloaded and installed by Android Studio (with all the platform-tools and build-tools). I have had no trouble writing the app, but as soon as I try to debug it as described here (Step 6), I get the following error:
BUILD FAILED
{WorkspacePath}\HelloWorld\.main.android.1\bin\build.xml:3: The following error occurred while executing this line:
{WorkspacePath}\HelloWorld\.main.android.1\bin\build-set-globals.xml:67: Cannot find C:\AndroidSdk\tools\ant\build.xml imported from {WorkspacePath}\HelloWorld\.main.android.1\bin\build-set-globals.xml
Total time: 895 milliseconds
(I'm the one who replaced the path to the workspace with {WorkspacePath}).
I have no idea what's going on and couldn't find anything on internet; any suggestion?
EDIT: I forgot to mention it, but the thing that is bothering me the most is that there's no "ant" folder in {SDKPath}/tools

Qt Jambi build failure (VS2010)

I've successfully built Qt 4.8.4 on Windows 7 and now I'm trying to build Qt Jambi against that version. When I run ant in the Qt Jambi source directory to kick off the build I get only part of the way and then I end up with the following
cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_QTJAMBI_IMPORT -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\qt-everywhere-opensource-src-4.8.4\include\QtCore" -I"..\..\qt-everywhere-opensource-src-4.8.4\include" -I"..\qtjambi" -I"..\common" -I"C:\Program Files\Java\jdk1.7.0_09\include" -I"C:\Program Files\Java\jdk1.7.0_09\include\win32" -I"." -I"..\..\qt-everywhere-opensource-src-4.8.4\include\ActiveQt" -I"release" -I"..\..\qt-everywhere-opensource-src-4.8.4\mkspecs\default" -Forelease\ #C:\Users\TYLERS~1\AppData\Local\Temp\nmFBCC.tmp qtjambishell_QLocale.cpp
..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(885) : error C2084: function 'jobject Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1int_1String__JILjava_lang_String_2(JNIEnv *,jobject,jlong,jint,jobject)' already has a body
..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(808) : see previous definition of 'Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1int_1String__JILjava_lang_String_2'
..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(909) : error C2084: function 'jobject Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1long_1String__JJLjava_lang_String_2(JNIEnv *,jobject,jlong,jlong,jobject)' already hasa body
..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(832) : see previous definition of 'Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1long_1String__JJLjava_lang_String_2'
..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(933) : error C2084: function 'jobject Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1char_1String__JCLjava_lang_String_2(JNIEnv *,jobject,jlong,jchar,jobject)' already has a body
..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(856) : see previous definition of 'Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1char_1String__JCLjava_lang_String_2'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
There are a few MSDN entries regarding this error number--http://msdn.microsoft.com/en-us/library/dt309377.aspx and http://msdn.microsoft.com/en-us/library/s99zy1dh(v=vs.100).aspx. Neither of these really helps much.
Has anyone successfully done what I'm attempting?
Building QtJambi on VS2010 does work.
Please confirm where you obtained your Qt SDK from and where you obtained your QtJambi sources from.
You should be working with Nokia or Digia SDKs or Qt Project. Such as 4.x from https://qt-project.org/downloads (note 5.x does not work at this time maybe for start of 2014).
You should be working from the git tree at https://qt.gitorious.org/qt-jambi/qtjambi-community (this is the only maintained tree). Please confirm the commit-id you are working with.
If you do not have git for Win7 take a look at http://git-scm.com/download/win once installed you can open the "git bash" shell and from a clean directory checkout the source with git clone git://gitorious.org/qt-jambi/qtjambi-community.git
Can you confirm you have correctly started your cmd.exe shell on Win7 from using the start menu options provided with VS2010. Such as Visual Studio 2010 Command Prompt and from here confirm you have setup the environment variables JAVA_HOME (pointing to your JDK) and QTSDK (pointing to the Qt SDK toplevel directory containing the desktop build for MS2010).
My guess is you are not using the correct Qt Jambi source tree. A patch has existed in the tree for 4.8.x support since Dec 2011. That appears to address the issue you are having.
Have successfully compiled QtJambi from QtJambi trunk at gitorious. Then I used the Qt 4.8.4 SDK from Qt-project.org. http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-vs2010.exe
I used it some months now and it works nice :).
Enjoy QtJambi!

xmlvm my android to iphone project

I have a working android app, I now have a new mac for the sole purpose of developing the same app on iphone. I have installed xmlvm on the mac and I moved by android app into the workspace and when I try and cross compile I get an error - could not find input resource: bin. Anybody here using xmlvm to cross compile android apps? Can you help with this error? There is a bin folder in my Test_One project.
pwd /Users/iosdev/Documents/workspace/xmlvm/Test_One
/Users/iosdev
iOS-Mac-mini:~ iosdev$ java -Xmx700m -jar /Users/iosdev/Documents/workspace/xmlvm/dist/xmlvm.jar --in=bin --out=out --target=iphonec --app-name=testone
[03/11/12 10:00:19.281] ERROR: InputProcessFactory: Could not find input resource: bin
[03/11/12 10:00:19.290] ERROR: XmlvmProcessor: No inputs to process.
[03/11/12 10:00:19.290] ERROR: Something went wrong during processing.
iOS-Mac-mini:~ iosdev$
Try with in=bin/, or with --in=bin/*. The problem is simple: It can't find the "bin"-resource, I guess it thinks of it as a file and not a directory.

Categories