grpc fails to load in electron - could not locate proto files - electron

OK I've got an electron app (5.0.6) which relies on GRPC node lib.
Dev build works fine.
Prod build, however, fails. I can run a successful prod build and create a windows installer, mac dmg etc. But when I start the app, only a blank screen appears. And I get this error:
Uncaught Error: ENOENT: no such file or directory, open 'google/protobuf/api.proto'
This file exists in node_modules, it's used by one of the dependencies (protobufs.js).
The same code runs fine with dev builds. But it always fails in production (on all platforms)
How can I solve this? Is this caused by the asar archive the prod build creates?
Thanks in advance

Related

Capacitor iOS App with Share Extension build fails with clean build folder

I'm creating a Capacitor App with the capacitor-share-extension plugin
As described in the documentation on Github, for iOS I first needed to create a "Share Extension" in Xcode.
When I build the app in Xcode everything works fine.
But when I clean the build folder in Xcode (Product -> Clean build folder), the build is failing. In consequence, I cannot build the app on a fresh machine or in my build pipeline, which blocks me from using the plugin. (For reference I'm using Bitrise Xcode Archive Plugin)
From the error, it looks like Xcode cannot find an appex file that is created in my local cache (but I also failed to include that file in my project folder). The error message is this:
Failed to set unique install ID on plugin <my-bundle>.<my-extension>
Failed to open /Users/<username>/Library/Developer/CoreSimulator/Devices/4A7360A3-D373-4A0A-BB08-AF354F97FFAF/data/Library/Caches/com.apple.mobile.installd.staging/temp.9hhnWo/extracted/Payload/<my-app>.app/PlugIns/<my-share-extension>.appex/<my-share-extension>
Failure Reason: No such file or directory
Is it possible to include all required files in my project folder so that I can build without the cache and without going through Xcode to manually create the Share Extension?
Or can I somehow create the Share Extension through a CLI command so that I can build in my build pipeline (already asked by this SO question Creating iOS share extension through the command line)?

How to build Appium Desktop from source code?

I'm trying to build the "latest" version of Appium Desktop from source (on a Mac), but I'm clearly not doing something that I need to be doing, because no binary is generated after I run all the build commands.
So, I've downloaded and unpacked the .zip archive https://github.com/appium/appium-desktop/archive/v1.16.0.zip, opened up a terminal session inside the root of the source directory, and followed the online instructions for building from source--but I think this is for the server build https://appium.io/docs/en/contributing-to-appium/appium-from-source/#running-appium-from-source
npm install
npm run build
node .
And it all appears to work successfully! I get a "build completed" message and life looks fab, but nothing launches as far as an app is concerned, and I can find no .app file anywhere in the source directory. And, oddly, there are no build instructions to be found anywhere in the source directory. There's a "ReadMe.md" file but it provides no instructions on how to build from source.
Can someone please tell me what I need to do to build and launch Appium Desktop (not the server) from source? (Oh, I also ran appium-doctor and it gave me a clean bill of health.)
Any feedback would be most appreciated!
Thanks,
Wulf
You've already run npm install so it should be as simple as running npm run dev if you want it in dev mode or npm start if you want non-dev.
See the Contributing to Appium Desktop readme for more.

ionic emulate ios (domain=com.apple.CoreSimulator.SimError, code=163)

I am trying to simulate a project with ionic using the command ionic emulate ios. I have installed xcode last version on mac Sierra. But no work. this is the error:
** BUILD SUCCEEDED **
No target specified for emulator. Deploying to iPhone-SE, 10.2 simulator
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):
Unable to lookup in current state: Shutdown
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):
Unable to lookup in current state: Shutdown
Error: ENOENT: no such file or directory, stat '/var/root/Library/Logs/CoreSimulator/4A052961-F773-4156-9D6C-76F137CC761B/system.log'
I found this solution(https://forums.developer.apple.com/thread/66665) but no work for me.
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/
Open a Project within Xcode
Cordova for iOS projects can be opened in Xcode. This can be useful if you wish to use Xcode built in debugging/profiling tools or if you are developing iOS plugins. Please note that when opening your project in Xcode, it is recommended that you do NOT edit your code in the IDE. This will edit the code in the platforms folder of your project (not www), and changes are liable to be overwritten. Instead, edit the www folder and copy over your changes by running cordova build.
Plugin developers wishing to edit their native code in the IDE should use the --link flag when adding their plugin to the project via cordova plugin add. This will link the files so that changes to the plugin files in the platforms folder are reflected in your plugin's source folder (and vice versa).
Once the ios platform is added to your project and built using cordova build, you can open it from within Xcode. Double-click to open the ${PROJECT_NAME}/platforms/ios/${PROJECT_NAME}.xcodeproj file. The screen should look like this:
https://cordova.apache.org/static/img/guide/platforms/ios/helloworld_project.png
Then follow the instructions to deploy to a simulator:
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#deploying-to-simulator
You will be able to see errors more clearly.
In my case it was the problem of an unmatched resource file. I simply deleted it.
After this, I tried:
sudo chown -R $USER:$GROUP ~/.npm sudo chown -R $USER:$GROUP ~/.config
in terminal and was able to run the app in a simulator

Archiving of project with a sub-project fails, but normal build works

I have a project which uses the ADALiOS project. This project is included in my project, and it works all fine when building to debug on my phone. However, I want to submit the App to the App Store and Archive but I get the following error:
PhaseScriptExecution Run\ Script /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX\ Dev/IntermediateBuildFilesPath/ADALiOS.build/Release-iphoneos/ADALiOS.build/Script-8B19339718BAEDE4008FD93A.sh
cd "/Users/User/Documents/Xcode development/azure-activedirectory-library-for-objc/ADALiOS"
/bin/sh -c \"/Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX\ Dev/IntermediateBuildFilesPath/ADALiOS.build/Release-iphoneos/ADALiOS.build/Script-8B19339718BAEDE4008FD93A.sh\"
Creating Framework folder structure at /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX Dev/BuildProductsPath/Release-iphoneos/ADALiOS
Copying public headers from /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX Dev/InstallationBuildProductsLocation/usr/local/lib/Headers/ADALiOS/
cp: /Users/User/Library/Developer/Xcode/DerivedData/projectX-gperwbbtttggqpcvozenraexrhrx/Build/Intermediates/ArchiveIntermediates/projectX Dev/InstallationBuildProductsLocation/usr/local/lib/Headers/ADALiOS/: No such file or directory
I am Archiving using the 'Generic iOS Device' option. I have tried a clean build followed many hints from other build problems but nothing seems to help.
Any suggestion on what could be wrong?
[EDIT:]
I got a clean version of the ADALiOS git repo and this too builds, but does not achieve with the same problem, so it could be related to the ADALiOS project, even though I do not knowhow and why.

Compiling Spark from Github

I am trying to compile Spark IDE for chrome apps from https://github.com/dart-lang/spark/tree/master/ide. Steps
Opened chrome://flags and enabled experimental api
Opened chrome://extensions and "Load unpacked extension" pointed to the local folder for the above code.
The app loads. On loading it is stuck with a loading animation forever
For running in Dartium you need to point to the app directory not the package directory.
You also need to run grind setup to copy the application to the app directory as the readme here says https://github.com/dart-lang/spark/tree/master/ide
I'm not sure this experimental settings are still necessary (probably not if you use a Dart development build which already includes Dartium 36)
For building to JavaScript you run pub build in the package directory and load the extension from build/web/app (normally it is done this way, not sure if this really works with Spark, haven't tried it myself yet)

Resources