Cordova crosswalk missing apks - node.js

I am very very new to Cordova, Android development, and Node.js applications.
I was using Cordova to create an Android app, it would spit out an android-debug.apk when I would go and build it.
BUILD SUCCESSFUL
Total time: 3.739 secs
Built the following apk(s):
/Users/me/Git/myApp/platforms/android/build/outputs/apk/android-debug.apk
Running command: /Users/me/Git/myApp/platforms/browser/cordova/build
Cleaning Browser project
Then I added Crosswalk plugin to help with some performance issues I was having and it worked great. Now when I try and build my app I get...
BUILD SUCCESSFUL
Total time: 2 mins 0.453 secs
Built the following apk(s):
Running command: /home/ubuntu/myapp/platforms/browser/cordova/build
Cleaning Browser project
It is missing the apk!! Why and how can I get an android-debug.apk to build?

Check in that output directory (.../myapp/platforms/browser/cordova/build) for android-armv7-debug.apk and android-x86-debug.apk. At least on my OS X system, this is what the build system kicked out after adding the crosswalk plugin.

So after further investigation Crosswalk outputs two apks to support both x86 and armv7 architectures. If you want to (as such in my case) only output one single apk do the following:
Make a file build-extras.gradle and put it into platforms/android/. Add the following line to file you just created:
cdvBuildMultipleApks=false
Now run cordova run android command, it will create combined single build android-debug.apk. You will see code of build.gradle doing this:
def hasBuildExtras = file('build-extras.gradle').exists()
if (hasBuildExtras) {
apply from: 'build-extras.gradle'
}

Related

React Native Awesome Project Build Fail

Been trying to run the start up AwesomeProject file in VS Code but every time I run npx react-native run-ios...the build fail below comes up. Have looked through the stacks, comments, and questions here but I cannot find anything that is applicable.
Tried to change my terminal and Xcode to load with Rosetta but I get an error there too...
softwareupdate --install-rosetta
Installing Rosetta 2 on this system is not supported.
Not sure where to go from here...
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/********/Library/Developer/Xcode/DerivedData/AwesomeProject-ekivgffrflagyugqmoefmykxoyqy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-337605CB7CDF90939BEBF863ED22C375.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)
info Run CLI with --verbose flag for more details.
I had this error too, i searched for hours...
What helped me was to downgrade version of react native to "react-native": "0.62.3" from 0.64
It also works with 0.63.
Others found this helpful: https://github.com/facebook/react-native/issues/32157

Executing VLC for unity

I am facing similar issue like this mentioned in the post:
Triying to run VLC for unity plugin demo
Build platform is WIN 10 x64 (build 2004).
I am using LibVLC from the nightly build: https://artifacts.videolan.org/vlc/nightly-win64-llvm/20200914-0434/
LibVLCSharp gets built successfully (https://code.videolan.org/videolan/LibVLCSharp/-/tree/master/).
I was trying to build "VLCUnityPlugin.dll" but failing (have installed https://github.com/mstorsjo/llvm-mingw/tree/20200325 (LLVM MinGW)), using MSYS64 to run ./build.sh and it was coming up with this error:
MSYS error while building VLCUnity plugin dll
I thought maybe since "VLCUnityPlugin.dll" is NOT present, Unity x64 (v 2019.4.8f1) keeps on complaining with the following errors:
UNITY errors
But after, I hacked "common" make file as shown below:
make file changes to build VLCUnityPlugin.dll
I successfully built VLCUnityPlugin.dll and my plugin file structure looks like this now:
Plugin directory structure
Still, I do see UNITY Errors:
"Assets\VLCUnity\Demos\Scripts\MinimalPlayback.cs(99,39): error CS1061: 'MediaPlayer' does not contain a definition for 'GetTexture' and no accessible extension method 'GetTexture' accepting a first argument of type 'MediaPlayer' could be found (are you missing a using directive or an assembly reference?)"
The free trial version is available for download here https://videolabs.io/vlc-unity/vlc-unity-windows-trial.unitypackage.
That being said, if you want to build it yourself, you should follow what the CI does https://code.videolan.org/videolan/vlc-unity/-/blob/master/.gitlab-ci.yml
The libvlcsharp build is a special one, you need to define UNITY when you build it. It has the added GetTexture method.
For VLCPlugin.dll, you should crosscompile from Linux, where you install llvm-mingw and run it from bash (for example). MSYS not needed.

adding npm module to Tabris results in a failed build with cordova

Being rather new to mobile app development i'm looking at Apache Cordova paired with Tabris.
Tabris requires a particular installation procedure, this creates a ./node_modules sub-folder under the regular ./www folder of a typical cordova project. Build cordova here is not a problem.
After adding 'npm install pouchdb' to ./www/node_modules now the cordova build fails again and again. I don't see what else changed but the addition of pouchdb. Strangely while pouchdb is reported to be just 46KB after installation many more modules were added and it now weighs in at 55MB. I suspect the many extra modules pose an issue.
I suspect i may need to tweak gradle but i'm most clueless where to start.
please advise
--- below the output indicating build failure
.... many lines of output preced
:processDebugManifest
:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-update-manager/build-tools/24.0.2/aapt'' finished with non-zero exit value 1
<<< this is supposedly output from gradle >>>
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 13.708 secs
Error: Error code 1 for command: /usr/sources/mobile/.../platforms/android/gradlew with args: cdvBuildDebug,-b,/usr/sources/mobile/.../platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
... replace path for anonymisation
<<< is my own inserted line >>>
First off: are you using Tabris or Tabris.js? The former is a Java framework and is not compatible with Cordova. The latter is, but if you're trying to use Tabris.js as a slave to Cordova (i.e. using the Cordova build command) that's not going to work. Instead I suggest you convert your project structure Tabris.js's style and then run the build there. If you still encounter errors when after converting your structure and building with Tabris.js, post the full build log in the Tabris.js issue tracker.

Facebook and google maps plugins don't work together in PhoneGap app

I am going to create the app that shows google map and required social login with facebook.
I decided to use:
https://github.com/Wizcorp/phonegap-facebook-plugin
and
https://github.com/wf9a5m75/phonegap-googlemaps-plugin
I don't know what is a reason, but these plugins perfectly work alone, but when I installed them together I got next error:
BUILD FAILED
C:\Users\{USER_NAME}\AppData\Local\Android\sdk\tools\ant\build.xml:577: Jar mismatch! Fix your dependencies
Total time: 1 second
{APP_PATH}\platforms\android\cordova\node_modules\q\q.js: 126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant debug -f {APP_PATH}\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen"
ERROR running one or more of the platforms: Error: {APP_PATH}\platforms\android\cordova\run.bat: Command failed with exit code 8
You may not have the required environment or OS to run this project
I am not experienced in PhoneGap development, but I guess that both plugins are doing some changes in platform dependencies (and rewriting changes of another plugin).
Could anybody help me with this?
I got the answer of google-maps plugin creator:
The facebook plugin contains android-support-v4.jar, and the map
plugin installs another android-support-v4.jar.
Remove one of them.
I took off android-support-v4.jar from com.phonegap.plugins.facebookconnect folder and left it in libs folder. It was solved my issue (fb and g-maps work together).
So I can mark this question as closed now.
I leave this answer for anybody who meets this issue like me.

Apportable load the tweejump-master makes errors

I try to use apportable to load the demo to my android phone.but have errors.
localhost:tweejump-master zhangxueyuan$ apportable load
Building with TARGET_ARCH_ABI:armeabi ARM_NEON:False
Building to /Users/zhangxueyuan/.apportable/SDK/Build/android-armeabi-debug
Warning: Falling back to toolchain version 4.7. Please run 'apportable update_toolchain'
Error: Could not find file /Users/zhangxueyuan/Downloads/android-ndk-r9/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin
and
localhost:tweejump-master zhangxueyuan$ apportable build
Building with TARGET_ARCH_ABI:armeabi ARM_NEON:False
Building to /Users/zhangxueyuan/.apportable/SDK/Build/android-armeabi-debug
Warning: Falling back to toolchain version 4.7. Please run 'apportable update_toolchain'
Error: Could not find file /Users/zhangxueyuan/Downloads/android-ndk-r9/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin
I refer to this link,and I think if the apportable will create a file to compile the project .
I think maybe change one file in the Folder:~/.apportable/SDK/site_scons/build/。
thanks
ok,i have find the answer。
i change the file /Users/zhangxueyuan/.apportable/SDK/site_scons/android/ndk.py
the number 303 to env['NDK_VERSION'] = '4.8'.
then
i apportable build the project again.
the result have errors: Could not find file /Users/zhangxueyuan/Downloads/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86/bin
i find the only have the drawin-x86-64.
so i copy them by myself
use cp -R darwin-x86_64/ darwin-x86/
and try build project again.
apportable run ok!

Resources