Error when add image to project - react-native

I created a project and then added an image in the project root directory.
In my index.android.js I added:
When run react-native run android, the error is displayed:
error: bundling failed: "Unable to resolve module ./my-icon.png from C:\\Users\\Ayala\\Documents\\Developer\\React\\BrunoDantas\\index.android.js: could not resolve `C:\Users\Ayala\Documents\Developer\React\BrunoDantas\my-icon.png' as a folder: it did not contain a package, nor an index file"

The problem is your path I think your code example is missing. But the problem is that the image is not able to be found.
Currently your code is I believe?
<Image source={require('./my-icon.png')} />
This means the image should be in the same folder as your index.android.js which I'm guessing it's not... We would need more information in order to tell you what the real problem is.

Related

Problem when linking react-native-vector-icons

I just started a new react-native project from zero, added react-native-vector-icons, but when i try to link it, I get the following, I have no idea why this is happening, I didn't change anything, it's a clen project.
error Something went wrong while linking. Error: ENOENT: no such file or directory, copyfile 'PROJECTFOLDER/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' -> 'D:\Codes\ReactNative\KosTimer\android\app\src\main\assets\fonts\AntDesign.ttf'
Please file an issue here: https://github.com/react-native-community/react-native-cli/issues
error ENOENT: no such file or directory, copyfile 'PROJECTFOLDER/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' -> 'D:\Codes\ReactNative\KosTimer\android\app\src\main\assets\fonts\AntDesign.ttf'
Because of this error, all my icons appear with a X inside a square
*PROJECTFOLDER is the place where is my project
The issue is caused by a missing assets/fonts folder inside the android project.
To solve the issue create an assets folder in your project.
Then inside that folder create a folder called fonts.
This is what should have:
<project root>/android/app/src/main/assets/fonts
If you want to do with one command, you can open a terminal at your project root and type:
For mac:
mkdir -p ./android/app/src/main/assets/fonts
For windows:
mkdir ./android/app/src/main/assets/fonts
Then you should be able to link the dependency as normal.

Compiling react-native project in android

when I try to compile my project in RN 0.35 using my terminal I receive this error:
What went wrong:
Could not list contents of '/MyProject/node_modules/.bin/detect-newline'. Couldn't follow symbolic link.
Any help?
UPDATED
Seems that the cli.js file was missed in the detect-newline folder.
I created a new project and then I have copied the cli.js file, after that everything worked fine.

Abc.app unsealed contents are present in the bundle root - Xcode, any change required to bundle?

I have switched my XCode version from 3.2.6 to 5.1.1, I have been asked to change the project settings and porting to a new format and resolved many compilation errors as well.
Now there is no compilation errors i could able to build my project successfully.
When I tries to sign the project using codesign v2 (mac 10.9.5) i could see the following error
"Abc.app unsealed contents are present in the bundle root"
To Resolve I have gone through the below link and tried to create a bundle structure as mentioned in it, but i'm missing something basically I don't know what it is.
Codesign: What are unsealed contents?
My folder Structure would be similar to below, if anyone has seen discrepancy kindly mention what i need to correct.
/src/Abc/
Abc.xcodeproj
build\
doc\
English.proj
Info.plist
Installer.pmdoc
InstallScripts\
Japanese.lproj\
Libraries\
Abc_Prefix.pch
Abc.pmproj
Package\
Resource\
*.png, *.icns, *.jpg, setting.plist
Source\
Uninstall\
zh_TW.lproj\
In my experience, this error message means I've left some files in the same folder level as the Contents folder.
Everything must be inside the Contents folder.
Try moving whatever files are on the same level as the Contents folder to somewhere inside the Contents folder.

Problem with FlashBuilder

I a bigginer to this FlashBuilder, i have developed an application, but when i want to run the app, an error "Unbale to resolve resource bundle "containers: for locale en_US" is showing, eventhough i did not configure any locales to my appl. My Flex Compiler shows only -locale en_US. Please help ?
You are likely loading a resource bundle called 'containers' but it cannot find the properties file for it. You will have to add a Source Path in project properties --> Flex Build Path under the 'Source Path' tab. I have bundles{locale} as one of my paths. Then create a bundles folder with containers.properties in it. It should then be able to find the file.

Problem with Flex Builder

I have created on sample mxml application. While running the
application, getting error:
File Not found: in bin-debug folder the mxml is not compiled to html.
Suppose i have created file name: newFlexTraining.mxml.when i run this
mxml, getting error, newFlexTraining.html is not available in bin-
debug.I checked in bin-debug folder in flerx builder, the html file is
not created. Earlier it was working fine.But now i am getting this
problem. Can you any one pls explain me ASAP.
Thanks,
Ravi
Did you modify html-template?
Delete everything from bin-debug folder, clean the project and rebuild it.
in bin-debug folder the mxml is not compiled to html is this the original message? Post the original error message.