cordova build Android error:Execution failed for task ':compileDebugJava' - cordova-plugins

I got error when I build the Android project,after I added cordova Camera plugin,can anybody give me a hand,thanks a lot.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
D:\Angular4\myApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\Angular4\myApp\platforms\android\gradlew cdvBuildDebug -b D:\Angular4\myApp\platforms\android\build.gradle -Dorg.gradle.daemon=true"
Command finished with error code 1: cmd /s /c "D:\Angular4\myApp\platforms\android\cordova\build.bat"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1 Error output:
D:\Angular4\myApp\platforms\android\src\org\apache\cordova\camera\CordovaUri.java:78: ����: �Ҳ�������
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
^
����: ���� M
�: �� VERSION_CODES
ע: D:\Angular4\myApp\platforms\android\src\org\apache\cordova\splashscreen\SplashScreen.javaʹ�û򸲸����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
1 ������

Related

Unable to build electron using manual method

I am trying to build electron (master) using the appended script on Ubuntu 22.04. Its throwing the following error (e build doesn't report this error). I am using the latest depot_tools, gn and node.js. Please help:
root#acs-x86-node1-ghatwala-rhel:/electron/src# gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"
ERROR at //electron/BUILD.gn:110:20: Script returned non-zero exit code.
electron_version = exec_script("script/print-version.py",
^----------
Current dir: /electron/src/out/Release/
Command: python3 /electron/src/electron/script/print-version.py
Returned 1 and printed out: 0a>\n/electron/src/electron/script/lib/get-version.js:19\n throw new Error('Failed to get current electron version');\n ^\n\nError: Failed to get current electron version\n at module.exports.getElectronVersion (/electron/src/electron/script/lib/get-version.js:19:11)\n at [eval]:1:37\n at Script.runInThisContext (node:vm:129:12)\n at Object.runInThisContext (node:vm:307:38)\n at node:internal/process/execution:83:21\n at [eval]-wrapper:6:24\n at runScript (node:internal/process/execution:82:62)\n at evalScript (node:internal/process/execution:104:10)\n at node:internal/main/eval_string:50:3\n\nNode.js v19.3.0\n"
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['node', '-p', 'require("./script/lib/get-version").getElectronVersion()']' returned non-zero exit status 1.
See //electron/build/args/all.gn:2:21: which caused the file to be included.
root_extra_deps = [ "//electron" ]
^-----------
mkdir electron && cd electron
gclient config --name "src/electron" --unmanaged https://github.com/electron/electron
gclient sync --with_branch_heads --with_tags --no-history
cd src
export CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools
gn gen out/Release --args="import(\"//electron/build/args/release.gn\")"
ninja -C out/Release electron

How to start triton server after building the Windows 10 "Min" Image?

I have followed the steps mentioned here.
I am able to build the win10-py3-min image.
After that I am trying to build the Triton Server as mentioned here
Command:
python build.py -v --no-container-pull --image=gpu-base,win10-py3-min --enable-logging --enable-stats --enable-tracing --enable-gpu --endpoint=grpc --endpoint=http --repo-tag=common:r22.10 --repo-tag=core:r22.10 --repo-tag=backend:r22.10 --repo-tag=thirdparty:r22.10 --backend=ensemble --backend=tensorrt:r22.10
I am getting error as below.
cmake : The term 'cmake' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\workspace\build\cmake_build.ps1:20 char:1 + cmake "-DTRT_VERSION4{env:TRT_VERSION}" "-DCMAKE_TOOLCHAIN_FILE=${en +..—+ Categorylnfo : ObjectNotFound: (cmake:String) [], CommandNotFoundException + FullyQualifiedErrorld : CommandNotFoundException
DEBUG: 86+ >>>> ExitWithCode 1;
DEBUG: 6+ function ExitWithCode($exitcode) >>>>
DEBUG: 7+ >>>> $host.SetShouldExit($exitcode)
DEBUG: 8+ >>>> exit $exitcode
DEBUG: 33+ if ( >>>> $LASTEXITCODE -ne 0)
DEBUG: 34+ >>>> Write-Output "exited with status code $LASTEXITCODE-; exited with status code 1
DEBUG: 35+ >>>> ExitWithCode 1;
DEBUG: 6+ function ExitWithCode($exitcode) >>>>
DEBUG: 7+ >>>> $host.SetShouldExit($exitcode)
DEBUG: 8+ >>>> exit $exitcode error: build failed
and for below command
python build.py -v --no-container-pull --image=base,win10-py3-min --enable-logging --enable-stats --enable-tracing --enable-gpu --endpoint=grpc --endpoint=http --repo-tag=common:r22.10 --repo-tag=core:r22.10 --repo-tag=backend:r22.10 --repo-tag=thirdparty:r22.10 --backend=ensemble --backend=tensorrt:r22.10
getting error as below.
"C:\tmp\tritonbuild\tritonserver\build\install.vcxproj" (default target) (1) ->
"C:\tmp\tritonbuild\tritonserver\build\ALL_BUILO.vcxproj" (default target) (3) ->
"C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core.vcxproj" (default target) (5) ->
(CustomBuild target) -> C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core\_deps\repo-common-src\include\triton/common/triton_json.h(641,35): error 02039: 'GetObjectA': is not a member of 'rapidjson::GenericValue<rapidjson::UTF8<c har>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>1 [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core\triton-core.vcxproll [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core .vcxproj]
C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core\_deps\repo-common-src\include\triton/common/triton_json.h(641,1): error 02530: 'm': references must be initialized [C:\tmp\tritonbuild\tritonserver\build\_ deps\repo-core-build\triton-core\triton-core.vcxproj] [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core.vcxproj]
C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core\_deps\repo-common-src\include\triton/common/triton_json.h(641,1): error C3531: 'm': a symbol whose type contains 'auto' must have an initializer [C:\tmp\tr itonbuild\tritonserver\build\_deps\repo-core-build\triton-core\triton-core.vcxproj] [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core.vcxproj]
C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core\_deps\repo-common-src\include\triton/common/triton_json.h(641,26): error C2143: syntax error: missing ';' before ':' [C:\tmp\tritonbuild\tritonserver\build \_deps\repo-core-build\triton-core\triton-core.vcxproj] [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core.vcxproj]
C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core\_deps\repo-common-src\include\triton/common/triton_json.h(641,46): error C2143: syntax error: missing ';' before 'y [C:\tmp\tritonbuild\tritonserver\build \_deps\repo-core-build\triton-core\triton-core.vcxproj] [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\triton-core.vcxproj]
C:\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'C:\tmp\tritonbuild\tritonserver\build\CMakeFiles\6f6d31a7577427f4fd89bcde8fd28163\triton-core-mkdir.rule;C:\tmp\triton build\tritonserver\build\CMakeFiles\6f6d31a7577427f4fd89bcde8fd28163\triton-core-download.rule;C:\tmp\tritonbuild\tritonserver\build\CMakeFiles\6f6d31a7577427f4fd89bcde8fd28163\triton-core-update.rule;C:\tmp\tritonbuild\tritonser ver\build\CMakeFiles\6f6d310577427f4fd89bcde8fd28163\triton-core-patch.rule;C:\tmp\tritonbuild\tritonserver\build\CMakeFiles\6f6d310577427f4fd89bcde8fd28163\triton-core-configure.rule;C:\tmp\tritonbuild\tritonserver\build\CMake Files\6f6d31a7577427f4fd89bcde8fd28163\triton-core-build.rule;C:\tmp\tritonbuild\tritonserver\build\CMakeFiles\6f6d31a7577427f4fd89bcde8fd28163\triton-core-install.rule;C:\tmp\tritonbuild\tritonserver\build\CMakeFiles\e0e8eabd6eb cadfabbd7ced13e471b12\triton-core-complete.rule;C:\tmp\tritonbuild\tritonserver\build\CMakeFiles\d677bfcd41cd12f160cbc1390c778655\triton-core.rule' exited with code 1. [C:\tmp\tritonbuild\tritonserver\build\_deps\repo-core-build\ triton-core.vcxproj]
2021 Warning(s)
6 Error(s)
Run Visual Studio Installer and ensure you have installed C++ CMake tools for Windows.
Run x64 Native Tools Command Prompt for VS2019
Run in the command prompt:
python build.py -v --no-container-pull --image=gpu-base,win10-py3-min --enable-logging --enable-stats --enable-tracing --enable-gpu --endpoint=grpc --endpoint=http --repo-tag=common:r22.10 --repo-tag=core:r22.10 --repo-tag=backend:r22.10 --repo-tag=thirdparty:r22.10 --backend=ensemble --backend=tensorrt:r22.10

FAILURE: Build completed with 4 failures

1: Task failed with an exception.
What went wrong:
Execution failed for task ':test:uit:testFirexCollector'.
Process 'command 'pytest'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
2: Task failed with an exception.
What went wrong:
Execution failed for task ':test:uit:testFirexE2E'.
Process 'command 'pytest'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
3: Task failed with an exception.
What went wrong:
Execution failed for task ':test:uit:testOrgPeopleCollector'.
Process 'command 'pytest'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
4: Task failed with an exception.
What went wrong:
Execution failed for task ':test:uit:testPrrqCollector'.
Process 'command 'pytest'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

cordova build error when `node cordova/lib/copy-www-build-step.js` in build phase

I am a web developer with no experience in iOS development. Now I'm using Cordova to build iOS app. Because I have no knowledge about iOS or Xcode, it is very hard for me. I always get error like the following output when I built in Xcode or built in command line.
Error info in Xcode build:
Run custome shell script 'Copy www directory'
PhaseScriptExecution Copy\ www\ directory /Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh (in target: myios)
cd /Users/jyjin/workspace/gitProject/Cordova/FirstProject/platforms/ios
/bin/sh -c /Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh
/Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh: line 2: 27158 Segmentation fault: 11 node cordova/lib/copy-www-build-step.js
Command PhaseScriptExecution failed with a nonzero exit code
Error info in command line build:
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory /Users/jyjin/Library/Developer/Xcode/DerivedData/myios-auhioanpfinvvvcrnvoaioslreyr/Build/Intermediates.noindex/myios.build/Debug-iphonesimulator/myios.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
xcodebuild: Command failed with exit code 65
I have read a lot of solutions on websites, and finally I found that there were some script in build phase:
NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js
after checking out the error message several times, I tried to remove && node cordova/lib/copy-www-build-step.js in Build Phases, it builds successfully, but with no page effect expected in html (Cause no www resource copied I think).
and I tried to check out some env PATH value in copy-www-build-step.js,so I wrote some log code in copy-www-build-step.js, but have no idea how to print js logs in Xcode. Then I found cordova-plugin-console, but npm doc said it is duplicated, and contains the last version for Cordova, and mine is also the latest.
Oh, God!One week passed... I just want to build an iOS app. It’s so hard to play. The ghost knows what I experienced:Configuring certificates, profile, building a Cordova app from scratch, even spending $99 to buy an apple developer account...
Just want to play an iOS app by myself in my free time ... Hope someone can help me ~~
-- From a desperate Chinese boy !
just update cordova-ios to latest version:
npm i cordova-ios#latest
you can see this problem being solved in this PR: #600, they changed the script from javascript to the old shell version and fixed the problem.
Workaround without updating the library
Enter in xCode in the Build Phases tab and click on "Copy www directory" phase, so change the script to:
$SRCROOT/__PROJECT_NAME__/Scripts/copy-www-build-step.sh
"__PROJECT_NAME__ " is the name of xCode project.
After this download the copy-www-build-step.sh script and put it inside the "__PROJECT_NAME__/Scripts/" path.
References
https://github.com/apache/cordova-ios/issues/540
https://github.com/apache/cordova-ios/pull/600/files
https://github.com/apache/cordova-ios/pull/146/files
Oh! I have fixed it~
Firstly, check the script:
NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js
currently error is xcodebuild: Command failed with exit code 65. This is the first error, the && should be & when running in the mac.
And then, the error turn to be Command /bin/sh failed with exit code 127.And I found xcode error message: node: command not found.
So I run find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1 in the command line. and get the node result path /usr/local/n/versions/node/11.12.0
run
node -v // v10.15.3
So I remove all script in build_phases, and give it node path for my real nvm node path, change build_phases like below:
/Users/jyjin/.nvm/versions/node/v10.15.3/bin/node cordova/lib/copy-www-build-step.js
Build success!
Summary! cordova auto build_phases script maybe not suit your environment, make sure build phase can get your node path!

Cordova Error code 65 for command: xcodebuild with args

i tried with some simple codes to build a task.
the steps like that:
cordova -d create hello com.example.hello HelloWorld
cd hello
cordova platform add ios
cordova build ios
and it threw error:
Create product structure
/bin/mkdir -p /Users/millet/hello/platforms/ios/build/emulator/HelloWorld.app
PhaseScriptExecution Copy\ www\ directory build/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
cd /Users/millet/hello/platforms/ios
/bin/sh -c /Users/millet/hello/platforms/ios/build/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
dyld: bad external relocation length
/Users/millet/hello/platforms/ios/build/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh: line 2: 15137 Trace/BPT trap: 5 node cordova/lib/copy-www-build-step.js
Command /bin/sh failed with exit code 133
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Copy\ www\ directory build/HelloWorld.build/Debug-iphonesimulator/HelloWorld.build/Script-304B58A110DAC018002A0835.sh
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/millet/hello/platforms/ios/cordova/build-debug.xcconfig,-project,HelloWorld.xcodeproj,ARCHS=i386,-target,HelloWorld,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/millet/hello/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/millet/hello/platforms/ios/build/sharedpch
my ios version is 4.1.1 and cordova version is 6.2.0 and xcode version is 7.2
I fixed by running following command:
chmod +x "[Path].sh"
Change Path to your path where showing in error messages

Resources