Is there any way to generate the apk by using any external JS bundle - bundle

We will create some common reusable react native components and share it across multiple teams, Where they will build the apk along with their own project specific components.
is there any way like we can generate the JS bundle and ship it to all projects like a reference and include this bundle while generating the .apk or .ipa out of it
Note: We don't want to host the base components into NPM.
Is it possible to include the external Js bundle and generate the release build Or id there any other way to achieve it in react native.?

I have not tried it but sounds logical to me for android on windows.
Create bundle by
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
and place the bundled file in respective directory
and for ios you can directly drag and drop bundle in xcode project.

Related

ERROR: main.jsbundle does not exist - React Native 0.60.4

I'm trying to publish my first React Native app in App store and when I'll build in Xcode:
Product > Archive
appears some error, but i already have main.jsbundle
main.jsbundle does not exist. This must be a bug with
echo 'React Native
Screen Error:
You can generate a new main.jsbundle using this command.
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
Run this command in your project directory.
In my case, I was able to fix the issue by removing main.jsbundle from Bundle Resources.
Open react native project in xcode
Check if Copy Bundle Resources build phase contains main.jsbundle
If it contains, remove it and build again
Clear watchman watches:
watchman watch-del-all
Delete node_modules:
rm -rf node_modules and run yarn install
Reset Metro's cache:
yarn start --reset-cache
Remove the cache:
rm -rf /tmp/metro-*
In Xcode, you should be able to find the main.jsbundle inside the Xcode project sidebar.
If it isn't there, then you should drag the main.jsbundle into your Xcode project (in the default template app you can find it at ios/main.jsbundle)
If it is in there, but red - then you need to build a copy of the main.jsbundle which you can do via react-native bundle (and some additional args which you can look up.
I was getting the error because of a bug in the code, instead of using simulator I was using Xcode to install a release build to my device which led to this error.
To fix this, run the app on the simulator make sure it builds and runs properly and then install it on your device.
Try this instead
Go to Xcode
Go to targets
Select Build phases from the top
Just remove main.jsbundle lib from Copy Bundle Resources in build phase
re-run again.

ionic4 app generate iOS files without www folder

I'm using ionic CLI version 4.12.0 to create an app, when I use this command ionic Cordova platform add ios
ionic CLI adding the Xcode files of my App, but when I run the App on the real device I get this error
ERROR: Start Page at 'www/index.html' was not found.
and
Internal navigation rejected - <allow-navigation> not set for url='about:blank'
I think my ionic CLI does not generate the www folder files like in ionic3 CLI, is there something missing. www folder is totally empty and not shown in Xcode files
As pointed out in the comments ionic cordova platform add ios will only download the needed tools for iOS.
To build the www directory, run ionic cordova prepare ios after adding the platform.
According to the docs, ionic cordova prepare ios does the following:
Perform an Ionic build, which compiles web assets to www/.
Copy the www/ directory into your Cordova platforms.
Transform config.xml into platform-specific manifest files.
Copy icons and splash screens from resources/ to into your Cordova platforms.
Copy plugin files into specified platforms.

Local images are not visible in React-Native app release build

In my react-native app I have "src" folder that includes a Images folder and screens folder.My screens folder have various components where I am uing local images from Images using following code.
<Image source={require('src/Images/logo.png')} />
logo.png is an image placed in Images folder, there are many more such images referenced like this.Now all these images are shown pretty well in development mode but when I generated the release apk using gradlew assemblereleaseand installed the apk on my device all images referenced in this manner disappear somewhere.
My react-native version is 0.40.
Solved by following answer of Chiranjhivi Ghimire
Steps -
Created assets folder at ../android/app/src/main/
copy and paste this command in command prompt
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
enter this command in cmd gradle assemblerelease.
done
equivalent solution for ios can be found at link
try running this
npm start --reset-cache

Bundle Multiple Xamarin apps in one pkg installer

I have few Xamarin apps and I want to bundle them all as a single pkg/installer and organize them into a folder under Applications similar to the following snapshot attached. Is there an option to specify additional Xamarin apps in the bundle settings of the project or any build script needs to be written? Can anybody point to some samples ?
Thanks,
Suma.
1. pkg installer: Packages
See Payload section to add folder and your .app files.
They also support Certification for signing Developer Installer and Commandline. Just check the documentation.
2. Automation Build script:
Use Packages to create .pkgproj file that config your bundle apps
Go Xamarin Studio -> Project Options -> Custom Command -> Add new Common After Build: add script to copy all bundle apps to a folder that configured by above .pkgproj file
Run command line packagesbuild of Packages to build the .pkgproj file
Finish. Get your .pkg installer file in Build folder.

How to build NodeJS in XCode IDE?

How can I build NodeJS within the XCode IDE as a project? NodeJS build instructions say that it should be built with:
./configure
make
make install
However I wish to build within the XCode IDE.
What I really want to do is embed NodeJS within my application, so I think if I can build NodeJS within XCode then I can just adjust it to add my application once I have NodeJS building and running.
I made some progress I think by getting V8 to compile in XCode, now I am trying to add NodeJS to the V8 project.
Run ./configure --xcode in node repository root and you will get node.xcodeproj file you want.
As of this commit in Node.js - https://github.com/nodejs/node/pull/20328 one must do -
./configure -- -f xcode

Resources