EXTENSIONS: convert Firefox extension to Safari extension - firefox-addon

I am trying to convert my firefox extension to a safari extension. To do that, I used these codes xcrun safari-web-extension-converter /path/to/extension .
In my package json, I wrote a script :
"start:safari": "npm run-script build:safari; xcrun safari-web-extension-converter ./dist --force --copy-resources --project-location ./safari ",
"build:safari": "cross-env TARGET=safari webpack --progress --config webpack.prod.js",
When I run 'start:safari' script it opens xcode. Then I build it, there occurs an error:
Probably because of that, my setIcon API not working. Also there is no error in console. How can I fix that problem? What is the reason?

Related

Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH. Could you tell me what the problem is?

I'm using npm install -g yo gulp to install yeoman and this is the error I'm getting
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Usr\local\gulp -> C:\Usr\local\node_modules\gulp\bin\gulp.js
C:\Usr\local\yo -> C:\Usr\local\node_modules\yo\lib\cli.js
C:\Usr\local\yo-complete -> C:\Usr\local\node_modules\yo\lib\completion\index.js
> yo#3.1.0 postinstall C:\Usr\local\node_modules\yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
× yo version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
√ npm version
Found potential issues on your machine :(
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\gulp\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ gulp#4.0.2
+ yo#3.1.0
updated 2 packages in 23.31s
Run the following command to see where npm puts global packages
npm config get prefix
You'll get output similar to this
/usr/local/Cellar/node/10.5.0_1
Copy the output or path and then using any code editor open your .bashrc or .zshrc file depending on the terminal you use and paste like so
export PATH="$PATH:"/usr/local/Cellar/node/10.5.0_1/bin/""
Then after saving run
source ~/.zshrc
Like Xander Cage said.
I have uninstalled node.js -> procedure here
I have restarted my PC.
Then I installed again node.js
It work.
The above didn't work for me at all.
The following solved my problem:
clean installed nodejs and followed steps by dv-here in thread: https://github.com/zkat/npx/issues/100
Note that my npm kept pointing to C:\usr...
I think I set the npm config set prefix= to something mistakenly due to which I was >getting the error. Here's how I fixed it:
Open CMD in "Administrator" mode.
npm cache clear --force
npm install
npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
npm config set prefix C:\Users\myname\AppData\Roaming\npm
I just ran into this issue on MacOS, and saw that all of my global npm binaries were symlinked into the /usr/local/bin directory, except for yo. I created a symlink using this command:
ln -s /usr/local/Cellar/node/12.10.0/bin/yo /usr/local/bin/yo
(Yours may vary)
And yo is now callable.
I had same issue and I really didn't want uninstall nodejs as I have a lot of package installed.
Tried also with the second answer and did not worked.
Then I found this ticked, that is been closed:
https://github.com/yeoman/yeoman/issues/1716
install with yarn command for me worked.
yarn global add yo
Seem then the installation went through with also binary installed.
Nevermind try to install it with npm getting same error, so looking for provide more infos

Electron fix "ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command"

I recently stepped down my electron application removed knex and sqlite since it was painfully complicated to creating a rebuild on windows also when i made an executable for windows sqlite database didn't seem to work. Linux executable worked fine with sqlite guessing the same with mac.
To use sqlite i had rebuilt the application using electron-rebuild. In order to clear the rebuild i did rm -rf node_modules && npm install
I have eventually decided to use IndexDB using dexie.
However now when i try to run my program from npm i get
ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
How do i fix this, why is it happening ?
NB: The application works just fine but this error i the terminal is just annoying and i have no idea why its happenning
Do a test,
electron /path/to/the/app [You will get that Error]
Try
electron --disable-gpu /path/to/the/app [You mayn't get that Error]
The fix was to add "--disable-gpu" to the command-line to force the
web view not to use gpu features. I was able to accomplish this in an
electron app by editing the package.json file in app root and changing
the line like "start": "electron ." to "start": "electron .
--disable-gpu"
Refer https://github.com/electron/electron/issues/7834#issuecomment-275802528
Based on Sudhakar RS answer , I made a script in my package.json to not use GL
here is my package.json
{
...
"scripts": {
"start": "electron --disable-gpu .", // --disable GL ERROR and use CPU
...
}
...
}
Then in your terminal run
npm run start
I had the same error running electron-quick-start but not when running electron-boilerplate.
Investigating the error I found this question and for me also, starting with "electron --disable-gpu ." prevents the error message. But I didn't have to do that with electron-boilerplate. So, comparing the two I traced the difference to the inclusion of electron-debug in electron-boilerplate and, ultimately, to this: process.stderr.fd.
Thus far, the minimal change I have found sufficient to avoid the error is:
diff --git a/main.js b/main.js
index 3508c8e..7df262b 100644
--- a/main.js
+++ b/main.js
## -2,6 +2,8 ##
const {app, BrowserWindow} = require('electron')
const path = require('path')
+process.stderr.fd;
+
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
So, now I am trying to understand what process.stderr.fd; does and how it prevents the error message from appearing. It seems odd that merely getting the file descriptor of stderr would prevent the error but evidently it does.
I am also curious about the relative merits of disabling the GPU Vs getting the file descriptor.
edit: it is sufficient to get the stream with process.stderr; it is not necessary to get the file descriptor.
My solution for issue:
"dev": ".electron-vue/dev-runner.js --disable-gpu"

Module not found: './app.module.ngfactory' i while build iOS app --prod --release

I have developed one app in Ionic and while I try to deploy my app with --prod its throwing below error and without --prod its working fine.
Command : sudo ionic cordova build ios --release --prod
Error :
Error: ./src/app/main.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in
'/Volumes/DATA/Dhanesh/Projects/FA
app/TestNewCordova/failure_analysis_app/Ionic/src/app' resolve
'./app.module.ngfactory' in '/Volumes/DATA/Dhanesh/Projects/FA
app/TestNewCordova/failure_analysis_app/Ionic/src/app' using
description file: /Volumes/DATA/Dhanesh/Projects/FA
app/TestNewCordova/failure_analysis_app/Ionic/package.json (relative
path: ./src/app)
Field 'browser' doesn't contain a valid alias configuration after using description file: /Volumes/DATA/Dhanesh/Projects/FA
app/TestNewCordova/failure_analysis_app/Ionic/package.json (relative
path: ./src/app)
using description file: /Volumes/DATA/Dhanesh/Projects/FA app/TestNewCordova/failure_analysis_app/Ionic/package.json (relative
path: ./src/app/app.module.ngfactory)
no extension
While if I remove --prod and just run sudo ionic cordova build ios --release
and without fail it build successfully.
I found many solution for above error but still didn't got any luck to come out from this error.
Ref I tried so far :
Try to find error in $ ./node_modules/.bin/ngc but there is no error log over there.
Some post on github also not working https://github.com/angular/angular-cli/issues/8858
Help me if nay one solved same problem with ionic build ios.
Thanks in advance!
Edit :
main.ts
import { platformBrowserDynamic } from '#angular/platform-browser-dynamic';
import { AppModule } from './app.module';
import { enableProdMode } from '#angular/core';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
Just upgrade the ionic app script using npm install #ionic/app-scripts#latest --save-dev and check once again run build using --prod flag

Ionic - app hangs on splash screen

My ionic app is hanging on the splash screen - it was working fine and then I added some code, and went to test, and it's getting stuck.
It gets to this point:
------ Debug phase ------
Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB...
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'
Executing commands in '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'.
(lldb) platform select remote-ios --sysroot '/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols"
(lldb) target create "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0/myApp.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:50188"
(lldb) target modules search-paths add /usr "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/usr" /System "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/System" "/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" "/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" /Developer "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/Developer"
(lldb) command script import "/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.py"
(lldb) command script add -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 7681 detached
The deviceready message never comes.
One thing I did that is kind of relevant is, when I was building or something ionic asked me to upgrade ios-deploy from 1.9.1 to 1.9.2. I think this started happening after I did that. I try to revert back to 1.9.1 but it won't let me:
ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Release/ios-deploy normal x86_64
(1 failure)
npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/Cellar/node/7.7.3/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy#1.9.1"
npm ERR! node v7.7.3
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! ios-deploy#1.9.1 preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.1 preinstall script './src/scripts/check_reqs.js && xcodebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./src/scripts/check_reqs.js && xcodebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ios-deploy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/eamonwhite/Downloads/ionicmane-master/npm-debug.log
That might not be the problem. I could really use some help I'm close to a deadline.
UPDATE
When I try to run in xcode the same thing happens, but xcode gives these errors:
2017-10-10 15:49:17.417901-0400 myApp[8476:3520766] Resetting plugins due to page load.
2017-10-10 15:49:38.433127-0400 myApp[8476:3520766] Failed to load webpage with error: The request timed out.
UPDATE
I figured out what was causing this - it's livereload - if I run it without that its fine...but I kind of need it to work to develop.
I didn't have my wifi enabled on my phone so it couldn't connect to ionic.
From my experience we have the same issue deviceready is never shown in our console log, the most possible case would be inconsistency of the Cordova Plugin one thing that you could do is to reinstall the plugins and try to delete your platform folder and make a clean build with npm cache clean .
Update:
Based on your update , how are you running your ios app ?
Are you running your app using the -l -c commands like below:
ionic run ios -l -c
if that is the case you may be noticed that this command changes a line in the config.xml file:
// from
<content src="index.html"/>
// to
<content src="localhost//192.1.168.0:8000" original-src="index.html"/>
So Changing it back to <content src="index.html"/> might fixes the issue.
Solution 2:
You probably need to whitelist the localhost in the following way:
<allow-navigation href="http://localhost:8100/*"/>
My best guess is that your iPhone did not yet prepare the debugger for iOS11. It does so when running your app the first time on an new iOS version. You have to open and run your project once using XCode then you should be fine. Please also make sure you have the most recent version of cordova-ios which is 4.5.1 (check the <engine name=ios"> tag in your config.xml).
Check whether you have the following tag in your config.xml
<allow-navigation href="*"/>
Also can you check whether this is observed only in iOS or also in Android.
Ran into this with Ionic 4. After adding iOS platform, running the following worked:
ionic cordova prepare ios

Xcode, Parse Crash Reporting, dSYM file not created

I have an iOS app, written in Swift in Xcode 6.2, using the Parse SDK 1.7.0. I've gone through the Parse Quick Start instructions for setting up crash reporting (including ParseCrashReporting.enable() in the AppDelegate), but it seems that my run script is having an issue. The error is: App "/Users/ben/Library/Developer/Xcode/DerivedData/MyApp-ahydphsjgdgefbhcdodokcmofehe/Build/Products/Debug-iphonesimulator/MyApp.app.dSYM" wasn't found. Command /bin/sh failed with exit code 1.
According to this, it seems that Xcode is not creating the dSYM file. In my Build Settings > Build Options I have changed Debug Information Format to "DWARF with dSYM file" for both Debug and Release. (Previously, Debug was set to "DWARF")
Should I change anything else in the Build Options?
Also, could this be the issue? export DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT=NO
Here is my run script:
export PATH=/usr/local/bin:$PATH
cd $PROJECT_DIR/parse
parse symbols "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Thank you in advance for any ideas about how to fix this.
Edit: Thanks to the answer from #udjat, I was able to run my app and run script (below) without the app crashing. And thanks to some bug fixes from Parse, the test crash reports are functioning now as well, though there is still a significant delay.
New run script:
echo "Parse Crash Reporting"
export PATH=/usr/local/bin:$PATH
CLOUD_CODE_DIR=${PROJECT_DIR}/parse
if [ -d ${CLOUD_CODE_DIR} ]; then
cd ${CLOUD_CODE_DIR}
parse symbols MyApp --path="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
echo "Finished uploading symbol"
else
echo "Unable to upload symbols"
fi
Crash test in AppDelegate:
func crash() {
NSException(name:NSGenericException, reason:"Everything is ok. This is just a test crash.", userInfo:nil).raise()
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
ParseCrashReporting.enable()
dispatch_after(
dispatch_time(DISPATCH_TIME_NOW, Int64(5.0 * Double(NSEC_PER_SEC))),
dispatch_get_main_queue(),
{ () -> Void in
self.crash()
});
}
After reading through the Facebook link #jairobjunior posted, I found the fix (at least for myself) in Árni Jón Reginsson's answer and modified a bit.
In the Parse document, your run script is:
export PATH=/usr/local/bin:$PATH
cd YOUR_PATH
parse symbols "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Instead, change it to:
echo "Parse Crash Reporting"
export PATH=/usr/local/bin:$PATH
CLOUD_CODE_DIR=${PROJECT_DIR}/ParseCloudCode(or wherever yours is)
if [ -d ${CLOUD_CODE_DIR} ]; then
cd ${CLOUD_CODE_DIR}
parse symbols YOUR_PARSE_APP_NAME --path="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
echo "Finished uploading symbol"
else
echo "Unable to upload symbols"
fi
And it takes a lot more than "up to one minute" for your crash reports to show up on Parse (took me more than 15 minutes). If it finished uploading, it will be there, you just need to be patient.
There is an open thread about this issue here: https://developers.facebook.com/bugs/587774604658221/
I am having the same problem, even trying to do manually it says file "wasn't found", but the file is there. One thing that I've noticed is that .dSYM is not a file, for me it seems to be a folder/package.
I found this to work..
export PATH=/usr/local/bin:$PATH
cd YOUR_PATH
parse symbols AppName -p "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Adding the app name and the -p to the parse line
Sorry I don't have the reputation to comment so I'll leave this as an answer.
I got the exact problem. Also using the latest Parse SDK. It is suspected that it is the problem of the latest CLI 2.0.0 since developers start getting the issues you're getting (and also I'm getting) after updating to 2.0.0
Subscribe to this Facebook bug reporting post to get the solution in the future.
https://developers.facebook.com/bugs/466020460223551/
At this moment it seems like the problem is from the SDK. So there is nothing to do except waiting for Parse to fix this.
(Thanks #jairobjunior for introducing me the Facebook bug reporting page!)
just wanted to let you know you're not alone: although my DSYM seems to upload fine, no crash reports from any of my apps ever show up on parse.com, no matter what I do. I've spent an hour checking every setting... all looks good. I use the same test crash as you do...
So, please update here if you find a solution to crashes not showing up on parse.com. thanks!
In my case the problem was probably create by changing the project name, anyway using the following script made it :
parse symbols MyAppName --path="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Where MyAppName is was what I found in the parse/config file :
{
"applications": {
"MyAppName": {
"applicationId": "....kjsldgjslkgjslkgj...",
"masterKey": "....lksjmll242dg2d1g2..."
},
"_default": {
"link": "MyAppName"
}
}
}

Resources