MSBuild Error: Reading build config file results in cordova-build error : TypeError: undefined is not a function -Android - visual-studio-cordova

I ran in to this problem while performing Apache cordova build through visual studio-2015 i get this following error.
VS2015;
npm -v - 5.7.1
Node -v 8.8.0
Cordova tools 6.5.0
Android project created with cordova-android#6.4.0
Last few lines of error log
> Prepared android project successfully
> No scripts found for hook "after_prepare".
> Checking config.xml for saved plugins that haven't been added to the project
> ------ Copied C:\Project\Mobile\bin\Android\Debug\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
> ------ Building platform: android
> Debug
> ------ Build configuration options: --debug
> No scripts found for hook "before_compile".
> ANDROID_HOME=C:\Users\<username>\AppData\Local\Android\sdk
> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
> Reading build config file: C:\Project\Mobile\build.json
> MSBUILD : cordova-build error : TypeError: undefined is not a function
> TypeError undefined is not a function
Any help is appreciated.

I think is node version related issue.
After a few try to build with VS Cordova Tools and latest version of Cordova, i have encountred some issues on latest node versions.
Try to downgrade node to Node 4.8.7 LTS
https://nodejs.org/en/blog/release/v4.8.7/

Related

Problem with yarn dependency using the rhino R package

I am trying the new R package rhino from the Appsilon team to build shiny apps.
Running on a Windows10 laptop I installed the dependencies node.js and yarn as described in this tutorial.
Here is the output of rhino::diagnostics() :
Windows 10 x64 build 19042
R version 4.1.0 (2021-05-18)
rhino: 1.0.0
node: v16.15.0
yarn: 1.22.15
Running rhino::build_sass() gives me this error:
yarn run v1.22.15
$ sass --no-source-map --style=compressed root/app/styles/main.scss:root/app/static/css/app.min.css
Error reading root\app\styles\main.scss: no such file or directory.
error Command failed with exit code 66.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error:
! System command 'yarn' exited with status 66.
i If you can't use Node.js and yarn, try using sass: 'r' configuration.
Run `rlang::last_error()` to see where the error occurred.
I am puzzled by the paths in the call to "sass" that start with "root/app". My app is located in my home directory:
"C:/Users/XXX/Documents/workspace/rhino_dummy"
Is it possible that these paths are wrong in the call?
Luckily, the suggested alternative with the deprecated libsass interpreter works for the sass example in the tutorial. It would be nice to have node.js with sass working on Windows10 for future more complex apps.
Edit 1, after Kat's comment
Thanks Kat for the quick feedback. I added sass via yarn add sass and tried again same error:
> rhino::build_sass()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ sass --no-source-map --style=compressed root/app/styles/main.scss:root/app/static/css/app.min.css
Error reading root\app\styles\main.scss: no such file or directory.
error Command failed with exit code 66.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error:
! System command 'yarn' exited with status 66.
i If you can't use Node.js and yarn, try using sass: 'r' configuration.
Run `rlang::last_error()` to see where the error occurred.
The warning is coming from the pckage.json file that was created by calling yarn inside my R project folder. It has only minimal content:
# package.json
{
"dependencies": {
"sass": "^1.51.0"
}
}
Out of curiosity, I tried to compile the javascript example, also failed with very similar error regarding folder paths:
> rhino::build_js()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ webpack
assets by status 0 bytes [cached] 1 asset
ERROR in main
Module not found: Error: Can't resolve 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js' in 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node'
resolve 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js' in 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node'
using description file: C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration using description file: C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\package.json (relative path: ./root/app/js/index.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js.wasm doesn't exist
as directory
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js doesn't exist
webpack 5.69.0 compiled with 1 error in 162 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error in `system_yarn()`:
! System command 'yarn' exited with status 1.
Run `rlang::last_error()` to see where the error occurred.
For Node.js functions to work on Windows 10, you'll need to enable Developer Mode on your system as mentioned in our How-to: Use Rhino on Windows article. This is necessary for symbolic links to work on Windows (and the .rhino/node/root file is a symbolic link to the root of the project).
After you do that, delete the .rhino/node directory from your project, or run rhino:::add_node(clean = TRUE) in the root of your project.
Workaround
This answer is only a workaround, if you cannot enable developer mode on windows (see Kamil Zyla's post for more information).
It looks like the folder name "root" in the error messages is a broken variable.
The folder ...\workspace\rhino_dummy\.rhino\node\root does not exist, but the substructures do exit:
app\styles\main.scss
app\js\index.js
...\workspace\rhino_dummy\.rhino\node
Fix step1
I tried my luck and created the folder "root": C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root
copied rhino_dummy\app\styles\main.scss to rhino_dummy\.rhino\node\root\app\styles\main.scss
copied rhino_dummy\app\js\index.js to rhino_dummy\.rhino\node\root\app\js\index.js
running rhino::build_sass() and rhino::build_js() now worked!
rhino::build_sass()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ sass --no-source-map --style=compressed root/app/styles/main.scss:root/app/static/css/app.min.css
Done in 0.45s.
rhino::build_js()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ webpack
asset app.min.js 470 bytes [compared for emit] [minimized] (name: main)
runtime modules 670 bytes 3 modules
./root/app/js/index.js 113 bytes [built] [code generated]
webpack 5.69.0 compiled successfully in 846 ms
Done in 2.58s.
Fix step2
copy results back to "static" folder, where they are expected by shiny/rhino
copy rhino_dummy\.rhino\node\root\app\static\css\app.min.css to rhino_dummy\app\static\css\app.min.css
copy \rhino_dummy\.rhino\node\root\app\static\js\app.min.js to \rhino_dummy\app\static\js\app.min.js
launch the app via shiny::shinyAppDir(".")
click the button from the tutorial ;-)
Edit1
Checking the github repo of rhino
SASS
definition of build_sass()
calling yarn("build-sass")
definition of build-sass
showing hard-coded root/app/styles/main.scss
JS
definition of build_js()
calling yarn("build-js")
definition of "webpack" build-js also showing hard-coded "root" in file paths

Error running flutter project using Firebase Database

I've been having this issue after adding firebase_database: ^7.0.0-dev.2 to my project. I've also looked at other issues on GitHub, here on S/O, and on the Flutter repo but to no success.
Some of the troubleshooting attempts I have tried include:
deleting the pod files, Podfile, Podfile.lock, etc.
running flutter clean and flutter pub get
running pod install
I've created a new flutter project and added firebase_core: ^1.1.0 and firebase_database: ^7.0.0-dev.2 to the pubspec.yaml. Therefore, I know the issue is not because of dependency conflicts with other flutter packages in my project.
Here is the output from the debug log when I try to run it on a simulator:
Launching lib/main.dart on iPad Pro (12.9-inch) (2nd generation) in debug mode...
Running pod install... 1,832ms
Running Xcode build...
Xcode build done. 3.4s
Failed to build iOS app
Error output from Xcode build:
↳
objc[4399]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f1f7c188) and ?? (0x117eb02b8). One of the two will be used. Which one is undefined.
objc[4399]: Class AMSupportURLSession is implemented in both ?? (0x1f1f7c1d8) and ?? (0x117eb0308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FWebSocketConnection.m:22:9: fatal error:
'FirebaseCore/Sources/Private/FirebaseCoreInternal.h' file not found
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FWebSocketConnection.m:22:9: note: did not find header
'Sources/Private/FirebaseCoreInternal.h' in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
1 error generated.
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/View/FView.m:18:
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Api/Private/FIRDatabaseQuery_Private.h:19:
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/FRepo.h:17:
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/FPersistentConnection.h:19:
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FConnection.h:17:
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Realtime/FWebSocketConnection.h:17:
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: fatal error: 'FirebaseCore/Sources/Private/FirebaseCoreInternal.h'
file not found
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: note: did not find header 'Sources/Private/FirebaseCoreInternal.h'
in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
1 error generated.
In file included from /Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/FValueIndex.m:21:
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: fatal error: 'FirebaseCore/Sources/Private/FirebaseCoreInternal.h'
file not found
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Utilities/FUtilities.h:17:9: note: did not find header 'Sources/Private/FirebaseCoreInternal.h'
in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
1 error generated.
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/View/FValueEventRegistration.m:18:9: fatal error:
'FirebaseCore/Sources/Private/FirebaseCoreInternal.h' file not found
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/FirebaseDatabase/FirebaseDatabase/Sources/Core/View/FValueEventRegistration.m:18:9: note: did not find header
'Sources/Private/FirebaseCoreInternal.h' in framework 'FirebaseCore' (loaded from '/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/build/ios/Debug-iphonesimulator/FirebaseCore')
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'leveldb-library' from project 'Pods')
/Users/hetpatel/Documents/MobileApps/FlutterProjects/flutter_application_1/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPad Pro (12.9-inch) (2nd generation).
Found a workaround for now:
dropped firebase_core to version "0.7.0" and firebase_database to ^6.0.0

Spring Starter with with Dependencies 'Spring Web' for Java 15 reports 'Failed to execute'

i downloadet
from
https://start.spring.io/
with Dependencies
Spring Web and
choosen Java 15
run mvn install
and got this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project java15dependnciesWeb: Fatal error compiling: error: invalid target release: 15 -> [Help 1]`
i surprized. I thought it should be able to be installed out of the box. I using Ubuntu.
Something similar errors:
This sound a bit like this error:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE:run
But this solution doesn't work for me:
https://stackoverflow.com/a/62742688/2891692
Tag name: version Description : The version of the parent project to inherit. Version : 4.0.0

Potential conflict between polymer build and tur-nr/polymer-redux

Description
I am experiencing unexpected errors when running polymer build after installing and using tur-nr/polymer-redux. Here is the demo repo.
Versions & Environment
polymer-build: v0.18.3 polymer --version
node: v6.10.2
Operating System: macOS Sierra v10.12.4
Steps to reproduce
terminal
git clone https://github.com/maria-le/redux # clone remote repo to your local
cd redux # cd into your local repo
bower install # install bower dependencies
npm install redux # install redux
polymer build # attempt build
Expected results
I expect the build to complete, without errors. Then allow me to serve the packaged build.
Actual results
I get the following errors in the terminal.
Error messages
src/all-locally.html(14,16) error [unknown-polymer-behavior] - Unable to resolve behavior store. Did you import it? Is it annotated with #polymerBehavior?
ReduxStore
src/imported-behavior.html(7,16) error [unknown-polymer-behavior] - Unable to resolve behavior ReduxStore. Did you import it? Is it annotated with #polymerBehavior?
polymerStore
src/imported-store-as-variable.html(10,16) error [unknown-polymer-behavior] - Unable to resolve behavior polymerStore. Did you import it? Is it annotated with #polymerBehavior?
PolymerRedux(reduxStore)
src/imported-store.html(7,16) warning [could-not-determine-behavior-name] - Could not determine behavior name from expression of type
CallExpression
error: Promise rejection: Error: 3 error(s) occurred during build.
error: Error: 3 error(s) occurred during build.
at BuildAnalyzer._done (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:229:36)
at BuildAnalyzer. (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:189:26)
at next (native)
at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
References
How to use polymer-redux with polymer-build?
polymer lint and polymer-build fail due to ReduxBehavior not registering properly
#polymerBehavior should still produce a behavior even if we can't evaluate the expression

Build.json Error: Package application for Android

Using Visual Studio RTM 2015 Blank Cordova (5.1.1) TypeScript project to test packaging applications for Android.
Following these instructions: https://github.com/Microsoft/cordova-docs/tree/master/tutorial-package-publish#android
Created the build.json and keystore.
When I publish (Release > Android > Device), I get the following error:
Reading build config file: D:\erase\BlankCordovaApp9\build.json
Command finished with error code 1: cmd /s /c "D:\erase\BlankCordovaApp9\platforms\android\cordova\build.bat --debug --buildConfig=D:\erase\BlankCordovaApp9\build.json"
ERROR building one of the platforms : error : cmd: Command failed with exit code 1
Are the instructions still accurate for 2015 RTM? Using the instructions I get Misssing a comma after an object member when using the suggested format in build.json.
Win 8.1

Resources