Ionic - Could not resolve com.android.tools.build:gradle:3.3 - ionic2

I'm trying to build my Ionic project and deploy it to my device, however every time I do I'm getting the following error message
`
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.3.
Required by:
project :
Could not resolve com.android.tools.build:gradle:3.3.
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom'.
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
Could not resolve com.android.tools.build:gradle:3.3.
Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom'.
Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom'.
Connect to maven.google.com:443 [maven.google.com/216.58.204.14] failed: Connection timed out: connect`
I can confirm that I've installed Gradle and that it's on the PATH
gradle -v
Gradle 3.3
Build time: 2017-01-03 15:31:04 UTC
Revision: 075893a3d0798c0c1f322899b41ceca82e4e134b
Groovy: 2.4.7
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_131 (Oracle Corporation 25.131-b11)
OS: Windows 10 10.0 amd64
And I have the following in build.gradle file
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3'
}
allprojects {
repositories {
mavenCentral();
jcenter()
}
}
But it still fails to build - any ideas here? I've also tried changing the mavenCentral() function to a maven = { url: 'http://maven.google.com' } object, but that doesn't work neither.
ben

Related

Error: Custom: Invalid blockhash when solana program deploy

Trying to deploy a program to solana devnet.
I was using
solana program deploy ./path/xxxx.so -u devnet
And I got multiple lines of
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
It gave me this error in the end
Error: Custom: Invalid blockhash
Tried search online but didn't get any useful informations
I was able to resolve this error by reverting to earlier versions of solana-cli and anchor-cli
solana-cli 1.8.0 (src:4a8ff62a; feat:1813598585)
anchor-cli 0.18.2
rustc 1.57.0 (f1edd0429 2021-11-29)
I also shared the above solution in this related github issue
One guess I have is that ExitStatus(unix_wait_status(256)) (which was in my error logs) could be a "time out error" from waiting too long due to slower deployment validation.
I did notice my deployments using later versions (solana-cli 1.9.1, anchor-cli 0.20.1) being significantly slower, especially for larger programs (my small program deployments were still working fine). These were the versions that showed similar "msg" logging as OP.
UPDATE:
Nowadays, my most fool proof solution is to run the snippet below before deployments
sh -c "$(curl -sSfL https://release.solana.com/v1.8.13/install)"
For deploying to devnet via Anchor, the error I got:
Error: Custom: Invalid blockhash
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
I have solved this:
Local npm package: #project-serum/anchor 0.20.1
Solana program dependencies: anchor-lang 0.20.1, anchor-spl 0.20.1, solana-program 1.9.4
deploy to devnet: failed
Local npm package: #project-serum/anchor 0.19.0
Solana program dependencies: anchor-lang 0.19.0, anchor-spl 0.19.0, solana-program 1.9.4
deploy to devnet: successful or failed
Local npm package: #project-serum/anchor 0.18.2
Solana program dependencies: anchor-lang 0.18.2, anchor-spl 0.18.2, solana-program 1.9.4
deploy to devnet: successful or failed
in all cases, the global environment is the same:
Rust 1.57.0
solana-cli 1.9.4
#project-serum/anchor-cli 0.20.1
it seems sometimes the transaction may fail and those transactions include program deployment. see reference: https://www.brianfriel.xyz/resending-dropped-transactions-on-solana/
This seems to be only because of anchor's version, I had the following versions installed:
Rust 1.59.0
solana-cli 1.9.6
anchor-lang 0.22.1
I couldn't deploy to devnet because of
Error: Custom: Invalid blockhash
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.
So I just changed anchor-lang to 0.22.0 and all worked well.
That's very strange, and not the normal output that you should get while deploying a program. Have you tried updating to the latest Solana SDK, which is 1.9.2 at the time of writing? More docs at https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool
I just tried this on devnet, and got the following output:
$ solana program deploy path/to/program.so -u devnet
Finding leader nodes...
[x/y] Transactions sent...
[x/y] Transactions confirmed. Retrying in z blocks.
Program Id: 6sxk3XpYapcRnpSwRKFS1nGK9MJpm8Jkb9aofnBcG1p8
For Mac M1,
Rust 1.57.0
solana-cli 1.8.0
#project-serum/anchor-cli 0.20.1
these tools' versions work.
I tried myself.
https://github.com/project-serum/anchor/issues/1157#issuecomment-1065828414
try solana cli 1.8.12 as 1.9.* seems to have issues deploying on devnet
I had similar error in chainlink contract github example. I changed this line in Execute Struct
pub system_program:Program<'info,System>,
to this:
#[account(address=system_program::ID)]
/// CHECK:
pub system_program:AccountInfo<'info>,
I had to import system_program
use anchor_lang::solana_program::system_program;
for me, to solve it my solana-cli version was 1.9.4 and I just updated with
solana-install update
and it's downgraded to 1.8.16 and deployed my program without any problem.
before this I can't deploy using anchor test(process) or solana program deploy.
Also, If you upgrade to one of the 1.10.X versions the issue will fix.

Migrating the wso2 APIs and Applications to a Different Environment

I'm setting up the API Manager Import and Export tooling for which we need deploy "api-import-export-2.6.0-v10.war" file to "/repository/deployment/server/webapps folder" where as it is throwing an error.
StandardContext Servlet [JAXServlet] in web application [/api-import-export-2.6.0-v10] threw load() exception
I'm using API Manager 2.6.0 and deployed "api-import-export-2.6.0-v10.war" which is of same version .war file. Tried another system where the error was same.
ERROR - StandardContext Servlet [JAXServlet] in web application [/api-import-export-2.6.0-v10] threw load() exception
java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet
Try a previous version of the jar and let me know if it works.
To use the latest war file, you need to WUM update WSO2 APIM 2.6.0. You are getting this error as you have not WUM updated the WSO2 APIM 2.6.0. In the docs, under step 1 you can get the previous version[1] or you can WUM update WSO2 API Manager following [2].
[1] - https://docs.wso2.com/display/AM260/Migrating+the+APIs+and+Applications+to+a+Different+Environment
[2] - https://docs.wso2.com/display/AM260/Updating+WSO2+API+Manager
I have sorted out the issue in my case as version compatibility among apimcli, import/export war file and WSO2 API-M server.
Issue was occurred due to the version (api-import-export-2.6.0-v10) mentioned as compatible by WSO2 not working properly with our APIM server and tried lowering the version and worked properly now.
WSO2 API-M version: 2.6.0
Import/Export tool version: APIMCLI v2.0.1
[Zip file downloaded for apimcli is ready for use no additional config was needed in my case]
Import/Export WAR file version: api-import-export-2.5.0-v1
[war file has been hot deployed to below path wso2am/2.6.0/repository/deployment/server/webapps/]
Below Commands executed:
Exported an already created API from DEV environment:
$ ./apimcli export-api -n ProfileManagementNJ -v v1.0.0 -r admin -e dev -k
Successfully exported API!
Find the exported API at /home/stwso2/.wso2apimcli/exported/apis/dev/ProfileManagementNJ_v1.0.0.zip
Imported the above exported API to ST environment:
$ ./apimcli import-api -k -f /home/stwso2/.wso2apimcli/exported/apis/dev/ProfileManagementNJ_v1.0.0.zip -e st --preserve-provider false
Successfully imported API
Actual error message details can be found as in below and are captured from console log:
$ ./apimcli export-api -n ProfileManagementNJ -v 1.0.0 -r admin -e st -k --verbose
Executed ImportExportCLI (apimcli) on Wed, 30 Oct 2019 13:41:52 UTC
[INFO]: Insecure: true
[INFO]: export-api called
[INFO]: ExportAPI: URL: https://172.26.41.4:9443/api-import-export-2.6.0-v10/export-api?name=ProfileManagementNJ&version=1.0.0&provider=admin&preserveStatus=true
apimcli: Error while exporting Reason: Get https://172.26.41.4:9443/carbon/admin/login.jsp: Auto redirect is disabled
Exit status 1
For more details on apimcli setup: https://docs.wso2.com/display/AM260/Migrating+the+APIs+to+a+Different+Environment#Example-exportAPI

Upgrading Apache Beam version to 2.11.0 fails with orchestration through apache airflow

Apache Beam Python SDK upgrade to 2.11.0 issue .
I am upgrading the sdk from 2.4.0 to 2.11.0 using requirements.txt. It has dependencies as below:
apache_beam==2.11.0
google-cloud-dataflow==2.4.0
httplib2==0.11.3
google-cloud==0.27.0
google-cloud-storage==1.3.0
workflow
For managing the dependencies in beam pipeline we have this txt file. There are two vm instance on google compute engine , one is master other is worker. These instances will install all packages listed in the requirements.txt file.
The jobs are run through DataflowRunner. If running the code manually using command as
python code.py --project --setupFilePath --requirementFilePath --workerMachineType n1-standard-8 --runner DataflowRunner.
The job is not upgrading the version to 2.11.0 , rather it fails .Error Message in stackdriver logs:
2019-03-26 19:02:02.000 IST
Failed to install packages: failed to install requirements: exit status 1
Expand all | Collapse all {
insertId: "27857323862365974846:1225647:0:438995"
jsonPayload: {
line: "boot.go:144"
message: "Failed to install packages: failed to install requirements: exit status 1"
}
labels: {
compute.googleapis.com/resource_id: "278567544395974846"
compute.googleapis.com/resource_name: "icf-20190334132038-03260625-b9fa-harness-gtml"
compute.googleapis.com/resource_type: "instance"
dataflow.googleapis.com/job_id: "2019-03-26_06_25_16-6068768320191854196"
dataflow.googleapis.com/job_name: "icf-20190326132038"
dataflow.googleapis.com/region: "global"
}
logName: "projects/project-id/logs/dataflow.googleapis.com%2Fworker-startup"
receiveTimestamp: "2019-03-26T13:32:07.627920858Z"
resource: {
labels: {
job_id: "2019-03-26_06_25_16-6068768320191854196"
job_name: "icf-20190326132038"
project_id: "project-id"
region: "global"
step_id: ""
}
type: "dataflow_step"
}
severity: "CRITICAL"
timestamp: "2019-03-26T13:32:02Z"
}
Note : When running the pip install apache-beam==2.11.0 on both worker and master , the code runs.*
I am not sure but most likely the issue here without seeing the rest of the logs. Is an incompatible dependency. Are you able to run the pipeline locally and see if you have any dep issues?

Cannot setup Ionic monitoring with ionic cordova build --prod

I tried the following command to try add the monitoring feature of ionic to diagnose a problem in my app using ionic view.
$ ionic monitoring syncmaps
git rev-parse HEAD
√ Running command - done!
[INFO] No sourcemaps found, doing build...
? Do full prod build? (Y/n) y ?
Do full prod build? Yes
[INFO] Running app-scripts build: --prod
[22:16:31] build prod started ...
[22:16:31] clean started ...
[22:16:31] clean finished in 1 ms
[22:16:31] copy started ...
[22:16:31] ngc started ...
[22:16:37] ngc finished in 6.08 s
[22:16:37] preprocess started ...
[22:16:37] deeplinks started ...
[22:16:38] deeplinks finished in 441 ms
[22:16:38] optimization started ...
[22:16:38] copy finished in 6.63 s
Error: ./src/pages/admin/admin.ngfactory.js
Module not found: Error: Can't resolve '../../../angularfire2/auth' in >'C:\Users\Gavin\Desktop\Web Development\app\src\pages\admin'
resolve '../../../angularfire2/auth' in 'C:\Users\Gavin\Desktop\Web Development\app\src\pages\admin' using description file: C:\Users\Gavin\Desktop\Web Development\app\package.json (relative path: ./src/pages/admin)
Field 'browser' doesn't contain a valid alias configuration
This error keeps going down the page for a long time, I get the same error if I type
ionic cordova build --prod
I resolved it by deleting .ngmodules folder, downgrading my firebase version to npm i --save angularfire2#4.0.0-rc.1 , and then npm install. I was then able to build my app with ionic cordova --prod

AWS elastic beanstalk git deployment suddenly failing due to composer issue despite no changes to composer.json

I have a number of environments running in AWS Elastic Beanstalk. I deploy direct from git using git aws.push.
I use composer.json to install required php sdk's. I've not changed this file for a long time but it's suddenly started failing in all environments.
Output from the AWS logs is
+ echo 'Found composer.json file. Attempting to install vendors.'
Found composer.json file. Attempting to install vendors.
+ composer.phar install --no-ansi --no-interaction
Loading composer repositories with package information
Installing dependencies
[RuntimeException]
Could not load package aws/aws-sdk-php in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ^5.3: Invalid version string "^5.3"
[UnexpectedValueException]
Could not parse version constraint ^5.3: Invalid version string "^5.3"
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
2015-05-28 09:57:18,414 [ERROR] (15056 MainThread) [directoryHooksExecutor.py-33] [root directoryHooksExecutor error] Script /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed with returncode 1
my composer.json is:
{
"require": {
"aws/aws-sdk-php": "2.7.*",
"monolog/monolog": "1.0.*",
"facebook/php-sdk-v4" : "4.0.*",
"ext-curl": "*",
"paypal/sdk-core-php": "v1.4.2",
"paypal/permissions-sdk-php":"v2.5.106",
"paypal/adaptivepayments-sdk-php":"2.*"
}
}
I notice it does want the aws-sdk-php but the version is not 5.3 (which is mentioned in the logs).
5.3 makes me think php version, checking php -v i get
php -v
PHP 5.5.12 (cli) (built: May 20 2014 22:27:36)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
I've tried re-installing older versions that have previously installed fine and they also fail with the same error. This has to be due to the environment. Does anyone know if there have been changes recently.
Create a folder in your root of the project called .ebextensions. Then create a new file in there called 01-composer-install.config with the following content.
commands:
01_update_composer:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
I just had to update composer using the instructions here:
https://getcomposer.org/download/