Unable to build ionic app on ubuntu 20.04 - android-studio

I am building my ionic app in ubuntu 20.04, I installed android studio, added the required build tools, and also installed ionic and cordova. But when I attempt to build my app using the command below
ionic cordova build android
I get the following error
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
I check the installed version of gradle using gradle -v and I get the following result
------------------------------------------------------------
Gradle 7.0
------------------------------------------------------------
Build time: 2021-04-09 22:27:31 UTC
Revision: d5661e3f0e07a8caff705f1badf79fb5df8022c4
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_282 (Private Build 25.282-b08)
OS: Linux 5.8.0-50-generic amd64
When I also check for the path using whereis gradle, I get the following result
gradle: /opt/gradle/gradle-7.0/bin/gradle.bat /opt/gradle/gradle-7.0/bin/gradle
When I run ionic info I get the result below
Ionic:
Ionic CLI : 6.13.1 (/usr/local/lib/node_modules/#ionic/cli)
Ionic Framework : #ionic/angular 5.3.2
#angular-devkit/build-angular : 0.1000.8
#angular-devkit/schematics : 10.0.8
#angular/cli : 10.0.8
#ionic/angular-toolkit : 2.3.3
Capacitor:
Capacitor CLI : 2.4.1
#capacitor/core : 2.4.1
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 20 other plugins)
Utility:
cordova-res : 0.15.3
native-run : not installed
System:
Android SDK Tools : 26.1.1 (/home/evans/Android/Sdk)
NodeJS : v10.19.0 (/usr/bin/node)
npm : 7.11.1
OS : Linux 5.8
What could be the problem?

Related

INSTALL_FAILED_NO_MATCHING_ABIS after updating Android Studio

I updated my Android Studio to the following version:
And started to get the following error:
The APK failed to install. Error: INSTALL_FAILED_NO_MATCHING_ABIS: INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113
while trying to install ARM APK on X86_64 emulator.
I am not sure what version I had before, but ARM APK installed successfully on my X86_64 emulator with that version on this emulator:

The framework 'Microsoft.AspNetCore.App', version '5.0.0' was not found. when it is installed and inside $PATH

I am working in Manjaro Linux.
I have a .NET Core project. The solution builds fine when I run dotnet build .
However, when I run:
dotnet-ef update --project Bejebeje.DataAccess --startup-project Bejebeje.Mvc
I get the following strange error:
Build started...
Build succeeded.
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '5.0.0' was not found.
- No frameworks were found.
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=x64&rid=manjaro-x64
It is strange because I already have the SDKs and runtimes for .NET 5.0 installed.
bejebeje|feature/upgrade-to-net-5 ⇒ dotnet --list-sdks
3.1.108 [/usr/share/dotnet/sdk]
5.0.103 [/usr/share/dotnet/sdk]
bejebeje|feature/upgrade-to-net-5 ⇒ dotnet --list-runtimes
Microsoft.NETCore.App 3.1.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
bejebeje|feature/upgrade-to-net-5 ⇒
Why is this happening? and what can I do to solve the problem?
I had the same problem. You need to have an ASP.NET runtime.
It's a bit confusing and easily overlooked, but it says you need an Microsoft.AspNetCore.App runtime, and your dotnet --list-runtimes only lists Microsoft.NETCore.Apps.
The ArchWiki mentions:
This is caused because the runtime is shipped as a separate package in Arch. You just need to make sure you have the aspnet-runtime package installed as well.
To install the .NET 5 runtime:
sudo pacman -Sy aspnet-runtime
or if you need the 3.1 version:
sudo pacman -Sy aspnet-runtime-3.1
Now there's an ASP runtime available:
$ dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] # <<<
Microsoft.NETCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Angular-CLI freezes on bulding

I moved to angular-cli and have a problem during production deployment. On local PC with win10 it's all ok, but when I try to build on centos server building freezes on 10%.
OS: CentOS 6.6
ng - v:
#angular/cli: 1.0.0
node: 6.10.1
os: linux x64
#angular/common: 4.0.1
#angular/compiler: 4.0.1
#angular/core: 4.0.1
#angular/forms: 4.0.1
#angular/http: 4.0.1
#angular/platform-browser: 4.0.1
#angular/platform-browser-dynamic: 4.0.1
#angular/router: 4.0.1
#angular/cli: 1.0.0
#angular/compiler-cli: 4.0.1
Then:
cd ~
ng new ngtest
cd ngtest
ng build
And I have this out in during 15 minutes without any changes.
10% building modules 3/3 modules 0 active
Htop shows 0% of processor. And console has no reaction on Ctrl+C. Only kill -9 from other terminal can stop this.
Can someone tell me what is wrong in my confiruration? Thanks!
Try to reinstall #angular/cli
Try to reinstall nodejs and npm
Try to update all soft with yum update
Try to restart the server

How to uninstall obsolete version of node.js from Ubuntu?

I have two versions of node.js installed on my Ubuntu server(Ubuntu 14.04, node.js v0.12.4 and v6.9.2), the version 0.12.4 was installed through downloaded archive file and the version 6.9.2 was installed through apt-get by following this. However whenever I run npm test command for my project, it can't find version 6.9.2 node.js(which needs node version >= 6.x.x), what should I do to uninstall the obsolete version 0.12.4 node.js?
I believe nvm could be the solution. BTW, node.js LTS version is currently 6.9.1

Gradle version issue (Unsupported major.minor version 52.0) on Ubuntu 16.04 with Android studio 2.2.2

Hello to all who are interesting in the issue,
I feel confused about gradle version in Android studio.
I am using the Android Studio 2.2.2. In the project build.gradle. I have classpath 'com.android.tools.build:gradle:2.2.2 which makes me believing the Android studio is using gradle 2.2.2.
In the gradle-wrapper.properties, It has https\://services.gradle.org/distributions/gradle-2.14.1-all.zip. So it means the gradlew build scripts requires 2.14.
When I tried to list tasks in the project, I used the terminal gradle tasks, I had following error:
java.lang.UnsupportedClassVersionError: com/android/build/gradle/LibraryPlugin : Unsupported major.minor version 52.0
And when I run gradlew -v I found the gradle version is 2.10. It could be me, I manually install the gradle by using apt-get install gradle. The default version might be 2.10.
My question is, which version gradle the android studio is using and how can I update the gradle to 'correct' version so I could list the tasks in the android project?
Edit 1:
I tried to update gradle to 2.14. By using
sudo apt-cache search gradle
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle-2.14
I also tried to upgrade the gradle to version 2.14.1, but still having the same error.
Thanks for your help
Rong
A solution of solving the version 52.0 issue One suggested solution (with the similar situation I am having) solved the problem by decrease the gradle version to 2.10, I really do not want to do that, since I wish to use the update-to-date version that android studio is using.
As to the solution solved that issue: I am already having the Android 6.0 API 23 installed in the Android studio. The Android SDK 6.0 does not fix the problem in my case.
environment:
Android studio 2.2.2
Java sdk: 1.7
OS: Ubuntu 16.04 LTS
Got it work Thanks.
I installed both java 1.7 and 1.8 and I was using 1.7 in the terminal by using sudo update-alternatives --config javac. By some reason, I believe the android uses java 1.8. I changed update-alternatives option to java 1.8. The command 'gradlew tasks' starting to work as expected.
yes, but update $JAVA_HOME$ also accordingly.

Resources