Ionic 5 default tab project - ionic-framework

I created new default tab project . I changed nothing. run the ionic serve no errors app opened in beowser its empty nothing.
After long investgation i found it opens the index.html inside src.
what happend why it is not lunching the real app.
I have ionic 5

It was a chrom problem. I had old version I upgrade it works fine. Looks old chrom dont understand type="model" for that it was nit downloading the js file

Related

flutter build web doesn't create flutter.js

I recently made a flutter application and now I want to get a web release, but when I run flutter build web and upload stored files in {root}/build/web on the host, everything is showing on chrome and firefox with that URL is an empty page with 2 console errors:
_flutter is not defined
GET https://web.pushers.ir/flutter.js 404
I took a look at my released files and didn't see any file named flutter.js, I tried flutter build web many times but nothing, also I tried to create another flutter project as a sample and ran flutter web build, on that sample everything was ok and flutter.js created with other released files
What should I do?
notice: it's working with Microsoft Edge, even while there is no file named flutter.js
Had the same issue.
Long story short: run flutter clean instead of manually deleting the /build/web folder or its content. The next build that follows will properly generate all files, including flutter.js.
More info why that is happening
I just copied flutter.js from a sample project release into my app release and it works

flutter build web - Only showing blank page

Strangely, I am unable to deploy flutter apps via Flutter web since some days.
I have not problem running and debugging the Flutter app in a chrome browser via Android studio but once I try
flutter build web
the generated index.html file unter /build/web/ will show a blank page with these errrors:
Chrome error messages image
I started a completely new project so the error will not be due to my bad code writing :P
Can somebody help?
just change to <base href="./"> in index.html after you build the web.
Try remove .dart-tool folder in your project folder and rebuild your projcet.
I had the same error and changing index.html not worked. I solved it by removing .dart-tool folder in your project folder. After removing it, IDE shows some errors but flutter build web works fine.
Here is the origin link. https://github.com/flutter/flutter/issues/61464#issuecomment-924577391
just Clear browsing data in privacy and security
if not see any error in the console
This is an old question, but it seems to perpetuate (I also crashed into it). So here is what helped me to solve the problem:
The doc says:
Update the <base href="/"> tag in web/index.html to the path where your app is hosted.
In my case, it was htdocs/app, so base href become <base href="/app">, which fix the problem for me.

window.Ionic.WebView.convertFileSrc not working in ionic 3

I am trying to display image selected from camera/gallery using cordova-plugin-camera plugin and used window.Ionic.WebView.convertFileSrc() for Rewriting file:// due to wkwebview.
It works fine in android platform but in iOS platform it gives error for Content Security Policy
For example I am getting
file:///Users/CN339/Library/Developer/CoreSimulator/Devices/XXXXXXX/data/Containers/Data/Application/XXXXX/Library/NoCloud/cdv_photo_002.jpg
from camera plugin and after using window.Ionic.WebView.convertFileSrc on previous local url I am getting below error.
Content Security Policy error
I tried a lot of methods to load local files such images or videos. I tried using
normalizeUrl (from ionic-angular)
regex and replace the local file path: path.replace(/^file:///, '')
window.Ionic.WebView.convertFileSrc()
None of above worked for me. The only way I could load a local file was using
window['Ionic']['WebView'].convertFileSrc(path);
Hope it works as you want. I have only tested it on Android
UPDATE
You can use win.Ionic.WebView.convertFileSrc(), like third bullet, only if you declare win: any = window.
To define win as any did the trick for me - https://stackoverflow.com/a/55934321/10243902
Just had the same problem on iOS after ionic-webview suddenly stopped working, so I uninstalled and reinstalled the plugin:
cordova plugin remove cordova-plugin-ionic-webview
cordova plugin add cordova-plugin-ionic-webview
window.Ionic.WebView.convertFileSrc started working like a charm again.
this.tempSchemeImagePath = window['Ionic']['WebView'].convertFileSrc(nativeURL);

Ionic 1 local notification not working in Ionic View app

So I'm using this plugin (https://github.com/katzer/cordova-plugin-local-notifications) for my app to have local notifications however it is not working when I have tested it.
I followed this tutorial https://devdactic.com/local-notifications-ionic/
I have tested the app on Ionic View on both android and iOS. I press the buttons but nothing shows up.
I have tried switching $cordovaLocalNotification with cordova.plugins.notification.local. when trying to use the functions in the plugin but that didn't work.
For what it's worth, the plugin does not show up in the package.json file but it does show up when I run the 'cordova plugins' command.
EDIT 1: The following is an image taken from my iPhone after I clicked Add notification
In my $ionicPlatform.ready(function(){...}), I have the following code
if(window.cordova && window.cordova.plugins.notification) {
alert('This alert doesn't fire');
}
The alert doesn't appear which means window.cordova.plugins.notification is unavailable just like the picture indicates
EDIT 2: On the ionic forums it was suggested that the plugin is not working on the Ionic View app as it is not one of the supported plugins. Please refer to: https://forum.ionicframework.com/t/katzers-local-notification-plugin/86748
However it does work when running/testing on a device(android) instead of the Ionic View app.
Add --save at the end of your command, something like:
cordova plugin add de.appplant.cordova.plugin.local-notification --save
It will add it to your config file.
Edit: Maybe you have error while using it. See error log by running the app with following command:
ionic run android -l -c
Finally running in the real device solved the issue.

Live reload is not working with Ionic serve command

As per the Ionic Guide Chapter 4 http://ionicframework.com/docs/guide/testing.html, ionic serve will start a live reload server, which it does in my case, but reload is not happening.
Is there any pre-req we need to have for this thing to work? Like say live reload chrome extension?
E:\Ionic\myapp>ionic serve
Running dev server: http://localhost:8100
Running live reload server: http://localhost:35729
Here is what worked for me:
stop ionic service if you running it 'q' command
run: ionic address from command prompt
After running this command it will prompt you to select what address you would like to use one is localhost and the second one is your machine IP address.
Try to use select your machine IP address instead of localhost.
Even I faced similar issue, console used to display the file changed but automatic browser refresh wasn't happening. Later I found out a missing closing tag in my index.html page that prevented ionic to inject the below script required for live reload.
<script src="//localhost:35729/livereload.js?snipver=1"></script>
Please check for any typo errors or other html issues in the index.html page and fix those. Live reload should word properly after that.
In Ionic 2/3, I solved this problem by removing the folder node_modules/ and file package-lock.json, then at terminal run:
npm install --save
I'm my case, I was bootstraping the app with this:
window.ionic.Platform.ready(function() {
angular.bootstrap(document, ['myApp']);
});
Then I changed it for this:
<body ng-app="myApp" >
<ion-nav-view></ion-nav-view>
</body>
And it works
if you want to get Live console logs in the ionic application (real
device or emulator)
ionic cordova run android --livereload --consolelogs --serverlogs