Read local asset in react-native-fs - reactjs

I have a file ("static.zip") in the root directory of my react-native project that I'm trying to access it via the react-native-fs library. Given this example, I thought it would be as easy as this on iOS:
sourcePath = `${MainBundlePath}/static.zip`
RNFS.readFile(sourcePath)
However, the file does not exist on that path. When I look inside at the contents of the MainBundlePath directory, I don't see any assets in there. I also tried adding static.zip to my Xcode project, but that didn't seem to do the trick either.

Adding the zip file to my Xcode target got this to work, at least on iOS. I was unable to implement a require() solution I found here: React-Native: How to open locally bundled binary file

You should manually put the file in to iOS Resource by Xcode and Android Asset by Android Studio, then use this package to load file path https://www.npmjs.com/package/react-native-file-asset

Related

How can I create a node module using lottie-react-native?

I'm building a React-Native component library.
I built a simple loader using lottie-react-native.
When installing the library locally, the component works.
After publishing the package on github and installing it, there is no error but the component is not displayed at all.
(FYI, I first encountered an issue installing it which has been resolved here : Why a dependency would not want to install when installing a library?
Now, the lottie-react-native dependencies appears in my node_modules).
I think I spotted the issue but I'm not sure and I don't how to resolve it.
First have a look at the freshly installed library's folder tree in the node_modules folder:
At this point, the lib folder shows an error, let's open it :
Ok, let's open the TS folder and sub-folders until I reach the error:
Now the index.d.ts file containing the error:
Originally, the assets folders contains the json files needed for the Lottie view.
When running the publishing process, my src folder is compiled to TS and the .d files are created.
I think the issue could be due to some tsconfig options or maybe the way I import things, but I'm not sure.
Here's the folder structure in the dev environnement:
Since it works fine when the lib is installed locally, I'm pretty sure that the issue occurs when compiling to TS.
What do you think?
Looks like you have 2 problems here.
png and json extension are not copied to the destination folder. You can fix this by copying manually or using tsc-hook.
.js extension files are not compiled. I think your tsconfig file has set emitDeclarationOnly to true. Try setting that to false.

DNN Module installation

Is it possible to "install" a module just by pasting the file of the module and just paste it into the DesktopModules folder and have the modules working on the website?
If not, is there a way where I can export the whole module from one system and install it onto another system?
Have you tried creating a module package for this module? (when you click the edit pen for the extension, you should find a "Create package" button on the top right).
Take care to include the assembly/assemblies needed, and also the Sql Server scripts to install the module correctly (often found in the module folder under Providers/DataProvider/SqlDataProvider/*.SqlDataProvider). There might be other files in the module folder (images, css, etc), be sure to include them in the package, then try to create it. You will find the ZIP file under /install/Modules then, move it away from there somewhere on your local file system (otherwise the installer might try to install it with the next update). Then try to update the extension in a testing system, check if it works and you're done. If there are errors it might be that you are missing some files that have to be included. Check the error messages, and restart.
There used to be a way using the /Install/Module/ folder (put ZIP file there, then call /install/install.aspx?mode=installresources) If you are on an old version of DNN (7 and earlier?) you can still use this. But you've got a load of security issues that should drive you to upgrade.
I don't know of a good way to do this now. For security purposes DNN removes the Install resources after an upgrade.
IF you already have the module installed in both locations, you could copy the resources for the file from server to server (DLL in the BIN folder and the contents of the desktopmodules folder) assuming you don't have any MANIFEST file changes that need registered.

The Download file for IOS debug build from codenameone is zip not IPA

I am successfully using codenameone netbeans.
After successfully compiling my app for send iOS debug build to codenameone and successfully completed, the downloaded file for MyApplication.IPA is zip not IPA.
So please help for this, for how to download the file as IPA not a zip file?
Any suggestion?
Thanks a lot.
We don't build zips in iOS targets. IPA files are technically zips in much the same way as JAR files are zips. But you shouldn't extract them or anything like that.
I'm guessing your browser detects the file format is a zip and is being stupid about it. I suggest trying a different browser.

copying cn1lib in lib directory does not work

I copied some .cn1lib files into my lib directory and refreshed it. But i'm not able to use these libraries.I am using Eclipse ide. What should i do ?
Is it related to codename one plugin for eclipse or specific to ide?
Check that you downloaded a valid file, the cn1lib should be a zip file. Its easy to verify it by copying it to the side, renaming it to .zip and checking that you can open it.
Also make sure you pressed the Refresh Libs option in the menu and not something else.

File Path to jar inside another jar

For an Eclipse plugin, I need to refer to a jar file inside the plugin directory (to provide code to users). This works perfectly when running the plugin while developing (inside a runtime-eclipse-application).
But when I build an update site, my plugin is built into a jar file. File paths for images are still working, but when the jar should be imported, eclipse shows the following error:
Description Resource Path Location Type
The container 'DoodleDebug' references non existing library 'file:\C:\Users\Me\.eclipse\org.eclipse.platform_3.7.0_740800064\plugins\ch.unibe.scg.doodledebug_1.0.0.201208281642.jar!\DoodleDebug-Client.jar'
The outer jar path is correct and when inspecting it with WinRAR, I can see the desired jar file inside it!
Why isn't this working as expected?
You will need to install your plugin in an exploded form. To do this, in your MANIFEST.MF file, add the following line:
Eclipse-BundleShape: dir
This will ensure that your plugin is installed as a directory, not a jar file. There is no way to reference nested jars, so they must be exploded.
See here for more information: http://eclipsesource.com/blogs/2009/01/20/tip-eclipse-bundleshape/

Resources