build a react-native ios app catch err: File name too long - xcode

build log shows repeat name
image err msg
CpResource /Users/apple/Library/Developer/Xcode/DerivedData/AugusReactApp-dpbgrpsyswtvjlgttmwlhxqkwbby/Build/Products/Debug-iphonesimulator/AugusReactApp.app /Users/apple/Library/Developer/Xcode/DerivedData/AugusReactApp-dpbgrpsyswtvjlgttmwlhxqkwbby/Build/Products/Debug-iphonesimulator/AugusReactApp.app/AugusReactApp.app (in target 'AugusReactApp' from project 'AugusReactApp')
cd /Users/apple/Documents/GitHub/AugusReactApp/ios
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/apple/Library/Developer/Xcode/DerivedData/AugusReactApp-dpbgrpsyswtvjlgttmwlhxqkwbby/Build/Products/Debug-iphonesimulator/AugusReactApp.app /Users/apple/Library/Developer/Xcode/DerivedData/AugusReactApp-dpbgrpsyswtvjlgttmwlhxqkwbby/Build/Products/Debug-iphonesimulator/AugusReactApp.app
error: open /Users/apple/Library/Developer/Xcode/DerivedData/AugusReactApp-dpbgrpsyswtvjlgttmwlhxqkwbby/Build/Products/Debug-iphonesimulator/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp.app/AugusReactApp: File name too long (in target 'AugusReactApp' from project 'AugusReactApp')
here is my build phases
image build phases
my xcode version is 13.2
react-native: "0.70.6"
I can't find any of the same problems

Related

Why does Apollo fail to build in Xcode - There can only be one fragment named ...?

Using:
Xcode 10.1
Apollo 1.9.2
CocoaPods 1.5.3
Latest build phase script from Apollo
During Xcode's build phase, when it executes the Apollo GraphQL API script, I get errors for duplicate fragments and operations, a-la:
"There can only be one fragment named..."
or
"There can only be one operation named..."
and the project will refuse to build.
Cleaning the build folder will allow you to build or run the project once more before the errors come back.
The issue is that the bash find command is finding duplicate files in a local DerivedData/ directory! This is caused when:
You have the DerivedData/ directory set to Relative in Xcode
You're using the default build phase script provided by Apollo
Change your build phase script for Apollo from this:
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-cli.sh codegen:generate --queries="$(find . -name '*.graphql')" --schema=schema.json API.swift
to this:
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-cli.sh codegen:generate --queries="$(find . -name '*.graphql' -not -path "*DerivedData/*")" --schema=schema.json API.swift
The Details:
If you don't care where your Derived Data goes, change the Location setting from Relative to Default (or any directory Apollo is not looking in). You can find the setting here: Xcode > Preferences > Locations > Derived Data
If you would rather keep your Derived Data where it is, alter the bash find command in the query passed to apollo-cli to exclude the DerivedData/ folder by appending -not -path "*DerivedData/*". You can find the script by going to Project Root > (Target Project) > Build Phases > Generate Apollo GraphQL API, (which you should have added during the installation steps, see here). Make it look like this:
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-cli.sh codegen:generate --queries="$(find . -name '*.graphql' -not -path "*DerivedData/*")" --schema=schema.json API.swift
You might need to delete the DerivedData/ folder one last time from your project folder, and it doesn't hurt to do one last clean (Command + Shift + K).

Adding dir to gitignore on windows

I am using smartgit on windows.
I am trying to add some directories in the repo to be ignored.
I am using the following .gitignore, that was recommended for Android Studio android application.
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
build/
# Local configuration file (sdk path, etc)
local.properties
# Windows thumbnail db
Thumbs.db
# OSX files
.DS_Store
# Eclipse project files
.classpath
.project
# Android Studio
*.iml
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/
#NDK
obj/
To my understanding, the Build folder should be ignored, but it is not being ignored. In addition the Build\Generated folder is being ignored, but that dir is not even added to the gitignore file.
Here you can see the build folder is not ignored yet the generated folder is.
With this
build/
you're telling git to skip the build directory entirely, so it will automatically ignore any files or directory in that path.
So the generated directory is correctly being ignored.
Now, the only reason (given your gitignore) for intermediate to be included, is that it was already committed on the repo before it became ignored.
If you want to start ignoring it, you need to remove it first, using
git rm -r --cached build/intermediate
As a bonus, if you want to ignore a directory, but not a subdirectory you can do
build/*
!generated
Here's a more thorough explanation on the subject: .gitignore exclude folder but include specific subfolder

I can't clone repo on windows with powershell

When I clone it keeps saying "Cloning into 'hack'..." but I can't find anything in C:\github and when i type cd project name I get the error message:
Set-Location : Cannot find path 'C:\github\'
It clone the project to the current folder,
cd into the folder with the name hack
# clone the project to the current directory
git clone <url>
# cd into the code folder
cd <project name>
The content is located in the current folder inside the cloned name.

Including plugins in Cocoa frameworks

In the build process of an OS X framework I have a Copy Filesbuild step, which copies 2 bundles to the PlugIns destination.
When I look in the built framework, they end up in Framework/Versions/A/Resources.
The related step in the build process:
PBXCp
/Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/GPHPieChart.bundle
/Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/Grapher.framework/Versions/A/Resources/GPHPieChart.bundle
cd "/Users/nephilim/Documents/Development/Cocoa Projects/Graphing Fun"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/GPHPieChart.bundle
/Users/nephilim/Library/Developer/Xcode/DerivedData/Graphing_Fun-egwutjdrujbsecgqukeyejeljxoo/Build/Products/Debug/Grapher.framework/Versions/A/Resources
When I run the code below, I get the folder Framework/Plugins:
[[NSBundle bundleForClass:[self class]] builtInPlugInsPath]
As such, I can't use my plugins this way. Is this an expected result, or a bug?
Context: I'd like to built my framework as basic as possible and extend it with plugins over time.
update
I tried using "PlugIns" as the destination for the copy files phase and it doesn't seem to work, Using "Wrapper" as the destination with "PlugIns" as the subpath does work however.
previous answer
Change your copy files phase to copy your plugins to the plugins path...

M2E Removes My Source Directory?

I have an existing library that I am building in Eclipse and have added the Maven nature to my project using m2e to add dependencies. When I convert it to a Maven project, my existing source directory (and my bin) become normal folders. Is there a reason for this? I am new to Maven, so I am likely doing something wrong, just not sure what...
My project structure is as follows:
workspace
project
src (in build path)
resources (in build path)
bin (output dir)
I tried both "mvn eclipse:eclipse" and right click on project -> Configure -> Convert to Maven Project, and both removed my src and resources folders from my build path, and after changing the structure to the below, changed the output to target/test-cases. Even if I manually adjust the build path and output, my dependencies don't resolve.
workspace
project
src (no longer in build path)
resources (no longer in build path)
bin (no longer output)
target (new output dir)
test-cases (empty)
I think you have the following structure when working with Eclipse (without Maven):
/workspace
/project1
.project
/src
/bin
But Maven want to use the following structure
/workspace
/project1
.project
pom.xml
/src
/main
/java
/resources
/test
/java
/target
/classes
/test-classes
and so on. So it is normal, that the folder src is no more directly a source folder for Eclipse, but now there are src/main/java, src/main/resources, ...
So it would be easier in the beginning to start with a new Maven project, and move your original sources to the directories they should belong to. Maven has a long tradition with its "convention over configuration", to deviate from that is possible. Have a look at the answer to "Handling unconventional source directory ..." to fix this.

Resources