sqlite porter "plugin_not_installed" on xcode - angularjs

xcode returns this error when I run my app in device (iPhone 6):
WARN: Install the SQLitePorter plugin: 'ionic cordova plugin add
uk.co.workingedge.cordova.plugin.sqliteporter' ERROR:
plugin_not_installed

run this
ionic cordova plugin add uk.co.workingedge.cordova.plugin.sqliteporter
npm install --save #ionic-native/sqlite-porter
and in app.module.ts
import { SQLitePorter } from '#ionic-native/sqlite-porter';
providers: [
SQLitePorter
]

Related

How to fix Error: capacitor.config.json does not exist, did you setup capacitor in your project root? when adding electron with capacitor in ionic?

I have a ionic-react project a I'm trying to add electron support using capacitor by doing:
ionic start blah tabs --type=react --capacitor
npx cap add #capacitor-community/electron
but it throws this error:
Error: capacitor.config.json does not exist, did you setup capacitor in your project root?
at Object.n [as doAdd] (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:6:1016)
at C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:12:363
at Object.g [as runTask] (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:2:1888)
at i (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:12:311)
at C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:12:718
at Object.parcelRequire.Focm../common (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:12:915)
at f (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:1:468)
at parcelRequire.FoEN (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:1:771)
at Object.<anonymous> (C:\Users\My-Name\blah\node_modules\#capacitor-community\electron\dist\cap-scripts.js:1:1023)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
I am changing the env variable INIT_CWD as set INIT_CWD=C:\Users\My-Name\blah\node_modules\#capacitor-community\electron following https://github.com/capacitor-community/electron/issues/76 but nothing seems to be working. The project just had capacitor.config.ts so I added the capacitor.config.json myself:
{
"appId": "io.ionic.starter",
"appName": "blah",
"bundledWebRuntime": false,
"npmClient": "npm",
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
},
"cordova": {}
}
I've updated versions of node,npm and ionic kindly help me with this issue.
In your ionic project root, you should have installed npm install #capacitor/core #capacitor/cli with the --capacitor option, please try the following:
install npm install #capacitor-community/electron
run npx cap init
ionic build
npx cap add #capacitor-community/electron
npx cap open #capacitor-community/electron

React native Could not determine java version from '10'

I am having a hard time trying to configure my emulator with react native. I already have the emulator installed but can't properly run the statement: react-native run-android this is the error I keep getting. (p.s. there seems to be no solutions in the troubleshoot. I have tried to change the gradle-properties which was ineffective)
C:\Users\Dell\AwesomeProject>react-native run-android
Scanning folders for symlinks in C:\Users\Dell\AwesomeProject\node_modules (31ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '10'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
I had the same issue. After upgrading to Ubuntu Bionic which comes with Java 10 which is not supported by react-native.
I'm using the following script now:
#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/
export PATH=$JAVA_HOME/bin:$PATH
react-native run-android
I change the env path to Java 8 and run the app.
You can try upgrading your gradle or downgrading java ... I would prefer upgrading your gradle.
Upgrading our Gradle
1 .Modify android/build.gradle :
Add google() inside repositories
buildscript {
repositories {
jcenter()
// add google() here
google()
Update com.android.tools.build.gradle to 3.1.0
buildscript {
repositories {
jcenter()
google()
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.2.3'
// update from 2.2.3 to 3.1.0
classpath 'com.android.tools.build:gradle:3.1.0'
Add google() inside repositories after dependencies :
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
allprojects {
repositories {
mavenLocal()
jcenter()
// add googgle() here
google()
Add android.enableAapt2=false to android/gradle.properties
android.enableAapt2=false // < --- add here
android.useDeprecatedNdk=true
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
Update gradle version in android/gradle/wrapper/gradle-wrapper.properties :
// from version 2.14.1
distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip
// change to 4.4
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
Runreact-native run-android. (This might take a while since it’ll be downloading the updated gradle version.)

Could not load module 'react/addons'

I have Jest+Enzyme setup to test my React app and I use brunch to build the app. When I run brunch, I got following error
Processing of node_modules/enzyme/build/react-compat.js failed. Error: Could not load module 'react/addons' from '/home/Project/node_modules/enzyme/build'. Possible solution: runnpm install.
But I have no trouble running Jest. I use yarn and yarn install does nothing as I have all packages installed. What is this missing react/addons package?
Solved the issue by telling brunch to ignore my test files
conventions: {
ignored: [
'**/*.test.js'
]
}

Ionic proxy not working with ionic CLI

I have added proxy in ionic.project
{
"name": "UNDP-App",
"app_id": "",
"proxies":[
{
"path":"/api",
"proxyUrl":"http://192.168.0.109/urautodeals/public/api"
}
]
}
As I run the ionic command ionic serve --lab, it did not load the proxy as shown in image below.
Updating the Ionic CLI to 3.19.0 fixed this for me. At the command line, enter:
npm install -g ionic
Note this does not change which framework version (1.3.1) you are using.

How to install ion-google-place in ionic cordova application?

I use following tutorial to install (ion-google-place) but I found sth.
my error is:
bower EMALFORMED Failed to read /home/binov1/ElolinkProjectversion2/bower.json
Additional error details:
Unexpected token $
my bower.json:
{
"name": "HelloIonic",
"private": "true",
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.1.1"
}
}
$ bower install ng-cordova-oauth -S
You can install ion-google-place after first creating the app. Here are quick instructions on how to do that:
source: http://ionicframework.com/getting-started/
Install node.js
Install cordov and ionic: npm install -g cordova ionic
Create your project folder: ionic start myApp tabs or choose a template of your choice
Move to your project folder: cd myApp
Create platform (iOS, Android, etc.): ionic platform add ios
Build the app: ionic build ios
Open emulator: ionic emulate ios
You can then install the plugin: bower install ion-google-place
Insert the your Google Maps javascript API:
<script src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
Add ion-google-place dependency on your ionic app:
angular.module('myApp', [
'ionic',
'ion-google-place'
]);
In your HTML markup, you can use the directive like this:
<ion-google-place placeholder="Enter an address, Apt# and ZIP" ng-model="location" />

Resources