'meteor build', cordova - error for ios platform - ios

I am trying to build my hello app (works on a web browser) for mobile platforms. I ran the command 'meteor build ../mobile/hello --server=localhost:3000' on the terminal. The build process for Android was successful but not for iOS.
Does anyone know what the issue could be?
Error:
=> Errors executing Cordova commands:
While preparing Cordova project for platform iOS:
Error: ENOENT: no such file or directory, open
'/Users/John/apps/hello/.meteor/local/cordova-build/platforms/ios/hello.xcodeproj/project.pbxproj'
I searched on google and some suggest it could be an issue with mobile-config.js file. I already checked that file and it seems ok.
// This section sets up some basic app metadata, the entire section is optional.
App.info({
id: 'com.example.hello',
name: 'hello',
description: 'hello',
author: 'John',
email: 'contact#example.com',
website: 'http://example.com'
});
// Set up resources such as icons and launch screens.
App.icons({
'iphone': 'icons/phone.png',
'iphone_2x': 'icons/phone2.png'
// More screen sizes and platforms...
});
App.launchScreens({
'iphone': 'splash/anotherPhone.png',
'iphone_2x': 'splash/anotherPhone2.png'
// More screen sizes and platforms...
});
// Set PhoneGap/Cordova preferences.
App.setPreference('BackgroundColor', '0xff0000ff');
App.setPreference('HideKeyboardFormAccessoryBar', true);
App.setPreference('Orientation', 'default');
App.setPreference('Orientation', 'all', 'ios');
// Pass preferences for a particular PhoneGap/Cordova plugin.
App.configurePlugin('com.phonegap.plugins.facebookconnect', {
APP_ID: '1234567890',
API_KEY: 'supersecretapikey'
});
// Add custom tags for a particular PhoneGap/Cordova plugin to the end of the
// generated config.xml. 'Universal Links' is shown as an example here.
App.appendToConfig(`
<universal-links>
<host name="localhost:3000" />
</universal-links>
`);

Delete from your project the folder /.meteor/local
launch Meteor again
Warning: you will loose your DataBase (it is located inside the local folder)
Tks #ghybs for the solution. I encountered the same issue and worked perfectly fine for me.

Related

Ionic capacitor/cordova blank screen

i've got a long issue with ionic. I tried to run through an emulator but all i got is a blank screen. Even with the default tabs app you get with ionic start
I've seen few answers talking about the capacitor config file but mine look like this.
const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'test-ios',
webDir: 'www',
bundledWebRuntime: false
};
export default config;
with webDirpointing to wwwlike it seems to be good for many people.

Ionic 5 capacitor/angular preview files from external url's

I have tried previewanyfile cordova plugin to open files from external url's in Ionic 5 application. It works well with android but on IOS I noticed sometimes it doesnt preview/open PDF files. Just a grey screen with the file name on it. But strangely some PDF files open.
file preview screen
previewProductDocument(url: string) {
const loading = await this.loadingController.create({
message: 'Loading document...',
});
loading.present().then(() => {
this.previewAnyFile.preview(url).then((res) => {
loading.dismiss();
}).catch((err) => {
loading.dismiss();
this.presentToast('Error previewing the document try later', 'danger');
});
});
}
This is the plugin I have used
https://ionicframework.com/docs/native/preview-any-file
capacitor version "#capacitor/core": "^2.2.0",
Noticed this behavior only in IOS simulator + on Real IOS device.
Any idea what is going on here?
Special character (%2F) in the link is the cause of the issue.
For a quick win; either change the link or sanitise before processing.
In this case url.replace('%2F', '/') should work.
However, another link may, probably, contain a different character. Without being 100% sure, it worth a try decodeURI, which is decodeURI(url).

Setting platform dependant icon via electron-forge electronPackagerConfig

Using electron-forge to build a desktop app. The app is built for both OSX & Windows. Inside my package.json, I have:
"electronPackagerConfig": {
"icon": "src/images/icon/app_icon_osx.icns"
}
When I build on Windows, I'm having to manually change the icon in package.json from "app_icon_osx.icns" to "app_icon_win.ico".
If I try to just use "app_icon.png" for both platforms, the icon doesn't show on OSX, and the build fails with "rcedit.exe failed with exit code 1. Fatal error: Unable to set icon" on Windows.
I have all 3 versions of the icon (icns, ico, png) in a folder in the project. Because i'm using electron-forge, i don't seem to be able to use electron packager's --icon argument.
Is there a way I can pass the icon to use as a command line arg, instead of hardcoded in package.json? Or a way I can use the same png for both platforms?
The extension is automatically added for each platform. Just supply an icon per platform like this: app_icon.icns, app_icon.ico, ...
Then update your config:
"electronPackagerConfig": {
"icon": "src/images/icon/app_icon"
}
The accepted answer works for macOS and Windows, but for Linux you'll have to do something like this:
Set the app icon (for the app list only) in the maker:
{
name: "#electron-forge/maker-deb",
config: {
options: {
icon: "./src/images/icon.png",
},
},
},
Create an assets folder (or anything) an copy it during the build with the copy-webpack-plugin in your webpack.main.config.js:
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
// ...
plugins: [new CopyPlugin([{ from: "./assets", to: "assets" }])],
};
You can now access any files inside this folder from your main process, so reference the icon when creating your BrowserWindow as documented here
mainWindow = new BrowserWindow({
// ...
icon: path.join(__dirname, "assets/icon.png"),
});
In forge.config.js, do:
const path = require('path')
module.exports = {
packagerConfig: {
icon: path.join(__dirname, 'favicon'),
},
}
Important notes:
If the file extension is omitted, it is auto-completed to the correct extension based on the platform, including when platform: 'all' is in effect.
This setting doesn't change the icon when running electron-forge start.
If the setting is correct, and you still don't see the correct icon, you might have encountered the icon cache issue.
If on Windows 10, run ie4uinit -show in the command line will show the latest icon.

Meteor mobile-config.js accessRule not working

I am getting a whitelist error when running my app on the iOS simulator. This is my mobile-config.js file which is located in client/js/mobile-config.js
App.info({
id: 'com.example.matt.uber',
name: 'über',
description: 'Get über power in one button click',
author: 'Matt Development Group',
email: 'contact#example.com',
website: 'http://example.com'
});
// Set up resources such as icons and launch screens.
App.icons({
'iphone': 'icons/icon-60.png',
'iphone_2x': 'icons/icon-60#2x.png',
// ... more screen sizes and platforms ...
});
App.launchScreens({
'iphone': 'splash/Default~iphone.png',
'iphone_2x': 'splash/Default#2x~iphone.png',
// ... more screen sizes and platforms ...
});
App.accessRule('*');
But the access rule doesn't update cordova's automatically generated config.xml file with the new accessRule.
UPDATE:
I moved the config-mobile.js to the root directory of my meteor project. Now the config.xml is being updated with the "*" access rule. BUT I still get a whitelist rejection error in the simulator. Please help!
Try adding access rules only as needed:
App.accessRule('https://*.cloudfront.net/*');
App.accessRule('https://pbs.twimg.com/*');
Also prefer using of https over http.

BlackBerry - Attribute Entry-Point-Icon: file cannot be found

I'm trying to pack and sign my Adobe Air 2.5 app for the PlayBook through the "BlackBerry Tabelt OS Graphical Aid".
I'm running into this error:
Warning: Using default icon: C:\Programme\Research In
Motion\blackberry-tablet-sdk-2.0.0\bin..\samples\icons\blackberry-tablet-default-icon.png
Error: Attribute Entry-Point-Icon: file cannot be found in the list of
packaged files: blackberry-tablet-icon.png
My blackberry-tablet.xml file:
<qnx>
<icon>
<image>blackberry-tablet-icon.png</image>
</icon>
<author>Foo Bar</author>
<category>core.games</category>
<splashscreen>xyz_splash_landscape.png</splashscreen>
<buildId>100</buildId>
<platformVersion>2.0.0.0</platformVersion>
</qnx>
Any ideas where the error comes from?
Thanks.
Add the icon in the Package using "Add additional files".

Resources