[I am getting error while building the android apk in ionic. It says "Could not reserve enough space for 2097152KB object heap. I tried various option but didnt work out. Please Help"][1]
<img src="https://i.stack.imgur.com/O7Oka.jpg">
I was facing the same problem. For me the solution provided by Roman Ashikhmin worked but I found that you also need following Environment Variable too,
GRADLE_OPTS : -Xmx2048M
along with the
_JAVA_OPTIONS : -Xmx1024M
Note: For _JAVA_OPTIONS I tried going over 1024M to 2048M or even 4096M but those options don't work. You can do 512M & or 1024M. For GRADLE_OPTS gogin over 2048M didn't work either.
I'm on:
Java 32bit jdk-8u141
global packages:
#ionic/cli-utils : 1.5.0
Cordova CLI : 7.0.1
Ionic CLI : 3.5.0
local packages:
#ionic/app-scripts : 1.3.12
#ionic/cli-plugin-cordova : 1.4.1
#ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 2.3.0
System:
Node : v6.11.0
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.10
Try to add a Windows Environment Variable named _JAVA_OPTIONS with value -Xmx512M.
It helped me to resolve the same issue.
Related
I am trying to run an Ionic project using Node version 14.18.3
I am using Volta to set this version for this one particular project
To do this I ran this command:
volta pin node#14
If I navigate to my project and run node -v then I see 14.18.3
When I try and build my project it fails and gives me an error that indicates that my node version is not 14
If I run ionic info then I see the following output. This shows that my node version is 16.13.1
Question - where is 16.13.1 coming from? How do I get Ionic to run using node 14?
Ionic:
Ionic CLI : 6.18.1 (/Users/chris/.volta/tools/image/packages/#ionic/cli/lib/node_modules/#ionic/cli)
Ionic Framework : ionic-angular 3.9.3
#ionic/app-scripts : 3.2.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 9.0.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 17 other plugins)
Utility:
cordova-res : 0.15.4
native-run (update available: 1.5.0) : 0.3.0
System:
Android SDK Tools : 26.1.1 (/Users/chris/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v16.13.1 (/Users/chris/.volta/tools/image/node/16.13.1/bin/node)
npm : 8.2.0
OS : macOS Monterey
Xcode : Xcode 13.2.1 Build version 13C100
I am trying to solve this issue. It seems to be an environment issue, but how to solve it ? how to connect the installed TSC to my console ?
Steps to Reproduce :
npm install -g typescript seems to install or update typescript#3.8.3 correctly
but then tsc -v says tsc: command not found
same steps in video
Console says (when trying to disable extensions) bash: code: command not found
my config :
VSCode Version: 1.43.1
Node.js : 12.8.1
OS Version: Darwin x64 19.3.0
Apple Model : MacBook Pro 14,3
MacOS : Catalina 10.15.3
Seems to be a problem with your PATH environment variable. Try echo $PATH in your terminal. It should display the list of your sytem paths which should include /usr/local/bin where tsc is located (same configuration as yours).
I followed the tutorial on the link below to create an ionic prepopulated database app but I get plugin_not_installed error.
ionic prepopulated db tutorial.
Other forums advised uninstalling the plugin and the platform and reinstalling but to no avail after several tries and even creating new ionic projects.
Find attached images of my config.xml file and my ionic info.
console.warn: Install the SQLitePorter plugin: 'ionic cordova plugin add uk.co.workingedge.cordova.plugin.sqliteporter'
console.error:
******[plugin_not_installed error][2]
**************Error plugin_not_installed
plugin list in config.xml
Ionic Info:
cli packages: (MY_DIRECTORY\npm\node_modules)
#ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages: cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : browser 5.0.3 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.4
npm : 5.6.0
OS : Windows 8.1
Environment Variables: ANDROID_HOME : not set
Misc: backend : pro
I called the native plugin within platform.ready in case someone wants to ask.
Thank you.
eventually my problem was that I was testing the app with "ionic serve -c" with Ionic DevApp which doesn't load native plugins.
My solution was to build the app to preferred platform (ios in my case) and test in Xcode and it works.
I just created a demo ionic project by ionic start conference, but when I tried to build the Android package, it tell me that TypeError: Cannot read property 'length' of undefined.
Then I tried to create another demo, ionic start blank, failed again.
ionic serve works all good and here is the information of ionic info
global packages:
#ionic/cli-utils : 1.1.2
Ionic CLI : 3.1.2
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-ionic-angular : 1.3.0
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.9.5
OS : macOS Sierra
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
Is there any dependency problem?
Use following command to build for android:
ionic cordova build android
When I try to create a new Ionic project then it will install files in the main project folder. I'm using Windows 10, with the latest version of Ionic and Node_JS.
It looks like this:
It should be something like this, when creating a new project:
If someone who experienced similar problems could help me then it would be greatly appreciated.
Ionic info gives me this:
global packages:
#ionic/cli-utils : 1.0.0
Ionic CLI : 3.0.0
System:
Node : v6.10.3
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed