Versions:
I am using Carthage as my package manager and within the last two days I have not been able to get the project to build because of this error
dyld: Library not loaded: @rpath/Motion.framework/Motion
Referenced from: /Users/macmedan/Library/Developer/CoreSimulator/Devices/43F98839-6A55-4C7F-917A-196EB7585DDC/data/Containers/Bundle/Application/4EF67EC1-9605-4AB7-9E5C-B0ECC9846C7D/Shipper Dev.app/Frameworks/Material.framework/Material
Reason: image not found
I have also noticed that this gets executed now when I do a carthage update
A shell task (/usr/bin/env git clone --quiet [email protected]:CosmicMind/Motion.git
I am using material version 2.11.2 and 2.11.0 gave me the same issue.
Any guidance would be greatly appreciated.
Hey @MacMeDan :)
Yes, I would be happy to help. Basically, now Motion is a submodule for Material. This is why it is making the clone call. This is a good issue, as it will help many people down the road. I am going to install now using Carthage and will get back to you in a moment.
So I may have made some progress on it but it throws a new issue.
If you first run carthage update The module should get checked out and then run carthage build to get it to install. I did not have trouble the first time and now the app will build but and subsequent times you do it this error is thrown.
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/macmedan/Swift/straightline/Shipper/Carthage/Checkouts/Material/Material.xcodeproj -scheme Material -configuration Release -derivedDataPath /Users/macmedan/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/Material/2.11.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/macmedan/Swift/straightline/Shipper/Carthage/Checkouts/Material)
is Bitcode enabled on the motion module by change?
Hope that helps. Let me know if there is more I can do. Also I would assume that if motion is a dependency that it would show up under the Material project's Checkout files in the Carthage Folder. At least that is what I see on other projects that have dependencies. I don't know how you enable that but it may be a place to look. 馃馃徏
Also I did have to update Carthage itself to version 27 recently.
Are you running this carthage update --use-submodules ?
No, I am not. Should I be?
Give that a try.
Ahh I see where I may have missed that. You need to use https://www.cosmicmind.com/danieldahan/lesson/6
Not
https://github.com/CosmicMind/Samples/wiki/Installation
The second link is found if you go to the samples Project and follow the installation link.
Ah yes, I am in the process of updating all the samples / repos / etc... Did it work with that flag being set?
No I got this
A shell task (/usr/bin/env git submodule --quiet update --init --recursive (launched in /Users/macmedan/Swift/straightline/Shipper/Carthage/Checkouts/Material)) failed with exit code 1:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:CosmicMind/Motion.git' into submodule path '/Users/macmedan/Swift/straightline/Shipper/Carthage/Checkouts/Material/Sources/Frameworks/Motion' failed
Failed to clone 'Sources/Frameworks/Motion'. Retry scheduled
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:CosmicMind/Motion.git' into submodule path '/Users/macmedan/Swift/straightline/Shipper/Carthage/Checkouts/Material/Sources/Frameworks/Motion' failed
Failed to clone 'Sources/Frameworks/Motion' a second time, aborting
Okay, I need to change it to https. One sec, I will make a change for that
Can you try this version Material 2.11.3 please :)
It looks like we are good. Thank you for your help.
To anyone reading this thread to solve the same problem you will need to delete your
Cartfile.resolvedfolder and your Carthage folder. Then run
carthage update --platform iOS --use-submodules in your terminal.
I lied I am back to this error.
dyld: Library not loaded: @rpath/Motion.framework/Motion
Referenced from: /Users/macmedan/Library/Developer/CoreSimulator/Devices/43F98839-6A55-4C7F-917A-196EB7585DDC/data/Containers/Bundle/Application/04B49666-5B10-4CB7-B174-30AE1E45F447/Shipper Dev.app/Frameworks/Material.framework/Material
Reason: image not found
ahh, it seems this may be the problem.
From Carthage project README
Note: At this time --cache-builds is incompatible with --use-submodules. Using both will result in working copy and committed changes to your submodule dependency not being correctly rebuilt. See #1785 for details.
Now I get this
A shell task (/usr/bin/env git submodule --quiet init -- Carthage/Checkouts/Material (launched in /Users/macmedan/Swift/straightline/Shipper)) failed with exit code 128:
fatal: No url found for submodule path 'Carthage/Checkouts/Material/Sources/Frameworks/Motion' in .gitmodules
Are you including the Motion framework ?
Sorry that was for a previous comment. I鈥檒l be back at my computer momentarily.
No, not implicitly. Which I was wondering about. So do I need to add it to my Cartfile b/c I did not see it as a built framework in the Carthage Folder.
Here is the .gitmodules file
submodule "Sources/Frameworks/Motion"]
path = Sources/Frameworks/Motion
url = https://github.com/CosmicMind/Motion.git
Can you try this --use-submodules --no-build ?
I don't personally use Carthage and never have, so I am a bit green on this. @mohpor maybe you know how to do this?
Well my question is the Material framework actually dependent on the Motion framework. I thought they were separate.
100%. Motion is the animation and transition arm in Material. As we add more animation based components, it will be pulling more from Motion. I separated them as Motion could be used without Material. Prior to this, Material copied the files over, and that was causing a maintenance issue. At the end of the day, I am happy that there are package managers out there, and I am sure this is not the first time this issue has come up, so there must be an easy solution for this. I will try and add Material and Motion to a new project tonight.
Awesome Let me know how it goes. I tried adding motion just like Material but it said the url was unresolved.
github "CosmicMind/Motion"
So I believe the issue was that I was missing a Cartfile that had the Motion dependency. So I added that in Material 2.11.4. Please read the installation guide if needed. Thank you for bringing this to our attention and if there continues to be an issue, please reopen this.
Awesome Thank You. 馃帀
It looks like it is working. Users will need to delete their Carthage.resolved and Carthage folder and then runcarthage update.
I'm experiencing a similar issue on Material 2.12.13. I tried deleting Cartfile.resolved and Carthage and using carthage update --platform iOS --no-use-binaries. I can see in the terminal that it is building Motion, however, I still get the same error as the original post.
@wflores96 Is this your first update to having Motion separate? Are you adding both Motion and Material to your project?
@danieldahan adding Motion framework fixed it! thank you
Add $(SRCROOT)/Carthage/Build/iOS/Motion.framework in "Input Files" section of "Run Script Phase" /usr/local/bin/carthage copy-frameworks