Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource bundle not copied into project #1186

Closed
akaralar opened this issue Jul 6, 2013 · 13 comments
Closed

Resource bundle not copied into project #1186

akaralar opened this issue Jul 6, 2013 · 13 comments

Comments

@akaralar
Copy link

akaralar commented Jul 6, 2013

Project with MapBox SDK 1.0.3 integrated builds okay but throws the following exception upon running.

2013-07-06 06:36:28.426 Demo[25507:c07] *** Assertion failure in +[RMMapView pathForBundleResourceNamed:ofType:], /Users/akaralar/Developer/work/socialiq/Demo/Pods/MapBox/MapView/Map/RMMapView.m:416
2013-07-06 06:36:28.432 Demo[25507:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Resource bundle not found in application.'

with cocoapods 0.22 the pod install was failing with mapbox sdk, 0.22.1 fixed that but now i'm getting this error. the library works okay when integrated manually.

--Podfile--

platform :ios, '5.0'

pod 'AFNetworking'
pod 'MapBox'
pod 'BlocksKit'
pod 'MBProgressHUD'`
@alloy
Copy link
Member

alloy commented Jul 8, 2013

@akaralar Can you check if removing the Pods/MapBox dir and running pod install again fixes the issue? Otherwise, can you list the contents of the Pods/Pods-resources.sh script?

@incanus I actually think the spec should be using the pre_install hook and use the pod argument’s root dir. This ensures it will also work when used as a local dev clone (with the :path option).

@akaralar
Copy link
Author

akaralar commented Jul 8, 2013

@alloy no it doesn't fix the issue, Pods-resources.sh is as follows

#!/bin/sh
set -e

RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"

install_resource()
{
  case $1 in
*.storyboard)
  echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
  ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
  ;;
*.xib)
    echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
  ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
  ;;
*.framework)
  echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
  mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
  echo "cp -fpR ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
  cp -fpR "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
  ;;
*.xcdatamodeld)
  echo "xcrun momc ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
  xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
  ;;
*)
  echo "${PODS_ROOT}/$1"
  echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
  ;;
  esac
}

rsync -avr --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rm "$RESOURCES_TO_COPY"
install_resource 'Resources/MapBox.bundle'

@alloy
Copy link
Member

alloy commented Jul 8, 2013

@akaralar @incanus Ah, you know, I think this is also fixed when changing to the pre_install hook, because then you can just include the resulting resource bundle in the resources attribute of the spec and this will all just work as expected. In short, ‘manually’ appending to the resources script is no longer supported.

@miminashi
Copy link

I got same Error.
I tried to add Pods/Resources/MapBox.bundle to "Copy Bundle Resources" manually, then it works.

@incanus
Copy link

incanus commented Jul 10, 2013

Taking a look at this. I feel like the resources process has been changing a ton lately, but this latest approach sounds pretty clean so I'm looking forward to getting this stabilized once and for all.

@incanus
Copy link

incanus commented Jul 10, 2013

Ok, I've been experimenting with altering my spec to something more like this: https://gist.github.com/incanus/231ba5fe1844aff2774d

However, now I'm getting build errors related to Proj4 and I'm not sure why.

@incanus
Copy link

incanus commented Jul 10, 2013

This is probably related to me (while editing) making MapBox a local pod.

Directory not found for option '-L/Users/incanus/Documents/Projects/Development Seed/MapBox/MapBox Me/Pods/MapBox/Proj4'

@incanus
Copy link

incanus commented Jul 10, 2013

Ok, in order to work around the local pod problem, I made a commit to the develop branch of our SDK to try this out in the podspec. But the bundle is still not being copied.

mapbox/DEPRECATED-mapbox-ios-sdk@20869b0

@nejra
Copy link

nejra commented Jul 16, 2013

is this going to be officially fixed or I must use older version of cocoapods?

@hfossli
Copy link

hfossli commented Jul 24, 2013

Any progress here?

@hfossli
Copy link

hfossli commented Jul 25, 2013

Okay. I have some new information and a solution which worked for me..

I have 3 targets in Xcode: "Core, Compdev, Test".

I had this Podfile

platform :ios, '5.0.1'

pod 'ReactiveCocoa', '~> 1.8.1'
pod 'JLRoutes', '~> 1.3'
pod 'AGGeometryKit'
pod 'AGMoviePlayerView', '~> 0.2.2'
# several other pods removed for clarity on github thread

target :compdev, :exclusive => true  do
    link_with ['IVYCompDev']
        pod 'ORKeyboardReactingApplication', :git => 'https://github.com/orta/ORSimulatorKeyboardAccessor.git', :inhibit_warnings => true
end

Then my Pods-compdev-resources.sh looked like this

#!/bin/sh
set -e

RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"

install_resource()
{
    # Code removed for clarity on github thread
}

rsync -avr --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rm -f "$RESOURCES_TO_COPY"

@hfossli
Copy link

hfossli commented Jul 25, 2013

After removing the :exclusive => true flag everything seemed correct.

This is what my Pod-compdev-resources.sh looks like now

#!/bin/sh
set -e

RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"

install_resource()
{
    # Code removed for clarity on github thread
}
install_resource 'AGMoviePlayerView/Source/AGMoviePlayerViewController.xib'
install_resource 'AGMoviePlayerView/Source/AGMoviePlayerViewController~iphone.xib'
install_resource 'AGMoviePlayerView/Graphics/mp_pause.png'
install_resource 'AGMoviePlayerView/Graphics/[email protected]'
install_resource 'AGMoviePlayerView/Graphics/mp_play.png'
install_resource 'AGMoviePlayerView/Graphics/[email protected]'

rsync -avr --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rm -f "$RESOURCES_TO_COPY"

@incanus
Copy link

incanus commented Jul 29, 2013

The MapBox spec is fixed now per mapbox/DEPRECATED-mapbox-ios-sdk#276.

jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013
gpalouk pushed a commit to gpalouk/mapbox-ios-sdk that referenced this issue Nov 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants