How to change schema validation for flutter's pubspec.yaml? - validation

When I specify version different from common standard, for example, version: 0.x.x, it does not get included into app version info after build and I get schema validation error during other build operations:
flutter --no-color pub get
Running "flutter pub get" in my_app...
Error on line 18, column 10 of pubspec.yaml: Invalid version number: Could not parse "0.x.x".
╷
18 │ version: 0.x.x
│ ^^^^^
╵
pub get failed (65; ╵)
Also I get a following tooltip:
Schema validation: String is violating the pattern: '^\d+\.\d+\.\d+(?:[+-]\S+)?$' that hints at obligatory regexp format that should be followed by version values.
How could I change pubspec.yaml validation schema in order to allow for versions of custom format?

i had same issue. In pubspec.yaml, I have set app version as :
version: 4.1+41000
Then, I replaced this with the line:
version: 4.1.0+41000
And issue was resolved. It is as per documentation written in pubspec.yaml file,
. # The following defines the version and build number for your application.
A version number is three numbers separated by dots, like 1.2.43
followed by an optional build number separated by a +.

Related

How to compile the assets to the VULKAN API using Harfang's asset compiler?

Trying to compile my graphics assets using assetc.exe (running Win10 64bits). The command line seems to be valid but I only get compilation errors.
Here's the commmand line :
assetc.exe resources -api VULKAN
first I get this feedback :
Harfang ASSETC 1.1
(4589:363:518:900) > Input dir: resources
(4589:363:659:500) > Output dir: resources_compiled
(4589:364:198:900)
(4589:364:655:800) > Target platform: windows
(4589:365:188:500) > Target graphics API: VULKAN
(4589:365:712:100) > Target pipeline: forward
but then it reports a lot of errors, as if none of the assets could be compiled :
557 input files
1240 output files
0 processed
585 failed
Saving compilation DB 'resources_compiled/assetc.cab'
Compilation done, took 965ms
what am I missing, here?
The correct syntax for the API switch is either DX11, DX12, GL, GLES or VK.
What you are looking for is VK that stands for Vulkan.
So, the command line shoud read like that :
assetc resources -api VK
Let me know if this works :)

Build settings in Android Studio on Windows

I am facing the problem while making the build of the app. Some files are autogenerated and during that some of the import paths are written wrong:
In update_attendance.ast.gql.dart
// GENERATED CODE - DO NOT MODIFY BY HAND
import 'package:firm_mobile%5Csrc%5Cnetwork%5Cgraphql%5Coperations%5Cevents%5Cupdate_attendance%5C__generated__%5Cupdate_attendance.ast.gql.dart'
as _i2;
import 'package:gql/ast.dart' as _i1;
Error:
[SEVERE] ferry_generator:graphql_builder on lib/src/network/graphql/operations/events/update_attendance/update_attendance.graphql:
Could not format because the source could not be parsed:
line 1, column 213 of .: An escape sequence starting with '\u' must be followed by 4 hexadecimal digits.
╷
1 │ import 'package:firm_mobile\src\network\graphql\operations\events\update_attendance\__generated__\update_attendance.ast.gql.dart' as _i5;import 'package:firm_mobile\src\network\graphql\operations\events\update_attendance\__
generated__\update_attendance.data.gql.dart' as _i2;import 'package:firm_mobile\src\network\graphql\operations\events\update_attendance\__generated__\update_attendance.var.gql.dart' as _i3;import 'package:firm_mobile/src/networ
k/graphql/schema/__generated__/serializers.gql.dart' as _i6;import 'package:built_value/built_value.dart';import 'package:built_value/serializer.dart';import 'package:ferry_exec/ferry_exec.dart' as _i1;import 'package:gql_exec/gql_exec.d
art' as _i4;
│ ^^
╵
Where in the settings of Android Studio I can check or change how the / has to be interpreted (format settings)?
I am using Windows. On Mac this problem doesn't appear. But I need to solve it on Windows.
Apparently, it is the problem of the package ferry_generator on Windows' machines. It is still an open issue, but there are some possible solutions.
Check this discussion.
Downgrade was not an option for me, so i set in the pubspec.yaml the github link to the ferry_generator.
It is working by now, no one knows how it will be in near future. Hope, that the issue will be solved soon.

How can I query contract info with the latest polkadot-js and substrate contracts node?

I've been unable to query my existing contract recently due to Unable to create Enum via index 128, in Alive, Tombstone when using api.query.contracts.contractInfoOf. I get this error both on the command line and in the polkadot-js apps explorer.
These are the steps I took:
Deploy a contract with a salt
Retrieve the contract deployedAddress
Use contractInfoOf
const contractInfo = await api.query.contracts.contractInfoOf(deployedAddress);
I've tried downgrading ink! to 3.0-rc5, 3.0-rc4, 3.0-rc3 and then compiling but it doesn't seem to make any difference. Whenever my contract is built it references rc6 at the top:
{"metadataVersion":"0.1.0","source":{"hash":"0x...","language":"ink! 3.0.0-rc6","compiler":"rustc 1.58.0-nightly",
Which suggests its ignoring my .toml and using rc6 to compile the contract.
I changed my cargo-contract version to 0.14 but that causes polkadot-js to fail at reading the contract abi.
I've tried using the substrate-contracts-node using the latest commit from master and also using the v0.1.0 release. Same error in both cases.
> rustup info
stable-x86_64-unknown-linux-gnu (default)
rustc 1.56.1 (59eed8a2a 2021-11-01)
There are more details in an issue on polkadot-js.
Any pointers on how to get a working setup would be very helpful!
The problem here was substrate-contracts-node using an old version of the metadata.
I was able to check out the repo before the metadata merge was reverted and build locally (cargo build).
So checkout 8d91b8e to get the node to work with versions 7.7.1 and 6.6.1 of polkadot-js packages.
> git checkout 8d91b8e578065a7c06433cbd41ac059bf478a0bd
> cargo build
> ./target/debug/substrate-contracts-node --dev --tmp --version
substrate-contracts-node 0.1.0-8d91b8e-x86_64-linux-gnu

Missing refs while upgrading a Nativescript plugin (tns-core-modules → #nativescript/core migration)

I'm updating an existing plugin in order to make it compatible with the upcoming nativescript release.
All references to the tns-core-modules package have been replaced with #nativescript/core.
The released documentation says that the new libraries should be retro-compatible with older versions. Unfortunately in this case something must have changed (related to the view lifecycle), and the plugin is not 100% working.
That's why I attempted a full migration of it's dependencies, but the build process was not possible due to some errors:
node_modules/#nativescript/core/ui/frame/index.d.ts:494:38 - error TS2304: Cannot find name 'ModuleContext'.
494 export function reloadPage(context?: ModuleContext): void;
...
map-view.ios.ts:80:40 - error TS2304: Cannot find name 'WeakRef'.
80 public static initWithOwner(owner: WeakRef<MapView>): MapViewDelegateImpl {
node_modules/#nativescript/core/ui/styling/style/index.d.ts:31:39 - error TS2304: Cannot find name 'WeakRef'.
31 constructor(ownerView: ViewBase | WeakRef<ViewBase>);
I can build the plugin by setting skipLibCheck: true in tsconfig.json. It makes the plugin compile, but the problem comes out later at runtime.
So it must be solved to complete the migration.
Any hints?
Thank you!
Maybe it's not the 100% recommended solution, but in case that the same problem does happen to you, add this line to your tsconfig.json:
"types": [
"#nativescript/core",
],

cordova windows error: "cordova/windows8/commandProxy" not found

I have built a Cordova-based Windows application. As soon as I add any plugin, the app starts crashing with the exception cordova/windows8/commandProxy not found.
Cordova version: 4.3.0
It seems that cordova/windows8/commandProxy is deprecated in Cordova 4.3.0.
I have replaced this statement in plugin file
require("cordova/windows8/commandProxy")
to
require("cordova/exec/proxy")
and it seems to work.
For example I changed line number 18 in PushPluginProxy.js from
require("cordova/windows8/commandProxy").add("PushPlugin", module.exports);
to
require("cordova/exec/proxy").add("PushPlugin", module.exports);
The name in the string varies depending on the plugin.
Alternatively, you can patch the plugin like in this pull request from the AppVersion plugin i.e.:
Change
require("cordova/windows8/commandProxy").add("AppVersion", AppVersionProxy);
to
cordova.commandProxy.add("AppVersion", AppVersionProxy);

Resources