Start a new topic

SDK 7.1 - Problem with configure_wikitude_sdk_framework.sh

Hi Wikitude,


I am trying the developer-release of SDK 7.1. When I try to add the plugin to my existing cordova project, I have the following error : 

 

Installing "com.wikitude.phonegap.WikitudePlugin" for android

Have fun using world's first AR plugin for PhoneGap. blabla....

Running command: 
/Users/amaury/dev/MuseoPic2/plugins/com.wikitude.phonegap.WikitudePlugin/scripts/configure_wikitude_sdk_framework.sh /Users/amaury/dev/MuseoPic2
Reconstructing WikitudeSDK.framework content. In case this script fails, please contact Wikitude support.
'./node_modules/com.wikitude.phonegap.wikitudeplugin/src/ios/WikitudeSDK.framework' is a valid Wikitude SDK.
'./platforms/ios/MuseoPic/Plugins/com.wikitude.phonegap.WikitudePlugin/WikitudeSDK.framework' is a valid Wikitude SDK.
Unexpected number of architectures found in WikitudeSDK. lipo output following
Architectures in the fat file: ./platforms/ios/MuseoPic.xcarchive/Products/Applications/MuseoPic.app/Frameworks/WikitudeSDK.framework/WikitudeSDK are: armv7 arm64 
Failed to install 'com.wikitude.phonegap.WikitudePlugin': Error: Hook failed with error code 255: /Users/amaury/dev/MuseoPic2/plugins/com.wikitude.phonegap.WikitudePlugin/scripts/configure_wikitude_sdk_framework.sh
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:232:23
    at _rejected (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:864:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:890:30
    at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:808:41)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:624:44
    at runSingle (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:137:13)
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
Error: Hook failed with error code 255: /Users/amaury/dev/MuseoPic2/plugins/com.wikitude.phonegap.WikitudePlugin/scripts/configure_wikitude_sdk_framework.sh


Before trying adding to add the plugin, I removed the previous version and cleaned my cordova project (cordova plugin clean).


Even with this error the plugin is listed as installed by cordova. I did not try to run my project to check if it was working.


Hi Amaury,

did you use any of the scripts included in the WikitudeSDK.framework on the framework before adding it to your Cordova project? It seems strange that only armv7 and arm64 architectures are included in the .framework.


Best regards,

Andreas

Same problem here (on Mac and Windows) when running 

cordova plugin add https://github.com/Wikitude/wikitude-cordova-plugin.git

after 

cordova plugin remove com.wikitude.phonegap.WikitudePlugin

 

Running command: /Users/spectral/Documents/Produktion-Cordova/spectral-ar/plugins/com.wikitude.phonegap.WikitudePlugin/scripts/configure_wikitude_sdk_framework.sh /Users/spectral/Documents/Produktion-Cordova/spectral-ar
Reconstructing WikitudeSDK.framework content. In case this script fails, please contact Wikitude support.
'./node_modules/com.wikitude.phonegap.wikitudeplugin/src/ios/WikitudeSDK.framework' is a valid Wikitude SDK.
Unexpected number of architectures found in WikitudeSDK. lipo output following
Architectures in the fat file: ./platforms/ios/build/device/Spectral-AR.app/Frameworks/WikitudeSDK.framework/WikitudeSDK are: armv7 arm64
Failed to install 'com.wikitude.phonegap.WikitudePlugin': Error: Hook failed with error code 255: /Users/spectral/Documents/Produktion-Cordova/spectral-ar/plugins/com.wikitude.phonegap.WikitudePlugin/scripts/configure_wikitude_sdk_framework.sh
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:232:23
    at _rejected (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:864:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:890:30
    at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:808:41)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:624:44
    at runSingle (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:137:13)
    at flush (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
Error: Hook failed with error code 255: /Users/spectral/Documents/Produktion-Cordova/spectral-ar/plugins/com.wikitude.phonegap.WikitudePlugin/scripts/configure_wikitude_sdk_framework.sh

 Is there a solution?

Hi,

Did you use the wikitude_strip_script.sh or a similar script to manipulate the architectures included in the WikitudeSDK.framework after the Wikitude plugin was installed?


Best regards,

Andreas

Hi Andreas you are right. Im running a script in Xcode Build Phases:


 

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

EXTRACTED_ARCHS=()

for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done

echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"

echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done

 A former version of my app was rejected by the apple app store and this was the solution. 

So I was able to install com.wikitude.phonegap.WikitudePlugin 7.1.0 after removing the Xcode build phase script, but when running the iOS app I'm getting this error:

 

The following build commands failed:
	CompileC /Users/spectral/Library/Developer/Xcode/DerivedData/Spectral-AR-cklipvoywiyditgablqqefrvlkls/Build/Intermediates/ArchiveIntermediates/Spectral-AR/IntermediateBuildFilesPath/Spectral-AR.build/Debug-iphoneos/Spectral-AR.build/Objects-normal/armv7/WTWikitudePlugin.o Spectral-AR/Plugins/com.wikitude.phonegap.WikitudePlugin/WTWikitudePlugin.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/spectral/Documents/produktion-cordova/spectral-ar/platforms/ios/cordova/build-debug.xcconfig,-workspace,Spectral-AR.xcworkspace,-scheme,Spectral-AR,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,Spectral-AR.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/spectral/Documents/produktion-cordova/spectral-ar/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/spectral/Documents/produktion-cordova/spectral-ar/platforms/ios/build/sharedpch

 

I tried: 
cordova platform remove ios

Cordova platform add ios

but didn't help.

If I remove the wikitude plugin, the app can be built and runs (without AR of course).

No problems if I go back to wikitude plugin 7.0.0

Hi,

Seems that you need to update to Xcode 9 as our SDK 7.1 includes some iOS 11 specific APIs.


Best regards,

Andreas

Login or Signup to post a comment