Having error "Command /bin/sh failed with exit code 127" with XCode from Unity Plugin

4,503 views
Skip to first unread message

Au Viroj Loharatanavisit

unread,
Feb 24, 2016, 6:42:44 AM2/24/16
to Google Mobile Ads SDK Developers
Hi,

I'm using AdMob on my project on both Android and iOS

This work fine on Android (Having a hard time with some errors on that side though.)

But I have problem with the unity plugin when building the XCode project to run on iOS

And here is the log I got.

run custom shell script 'check pods manifest.lock'

PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/Au/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvoadlqlqdvjifcsptlqzabqsbkp/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-E34AD8BC3640829829FC6C1E.sh
   cd /Users/Au/build-test/build
   /bin/sh -c /Users/Au/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvoadlqlqdvjifcsptlqzabqsbkp/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-E34AD8BC3640829829FC6C1E.sh

/Users/Au/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvoadlqlqdvjifcsptlqzabqsbkp/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Script-E34AD8BC3640829829FC6C1E.sh: line 2: null: command not found
Command /bin/sh failed with exit code 127

The plugin version I used is v3.0.1

I have no idea about this, the only clue that I got are

- run custom shell script 'check pods manifest.lock' and

- Command /bin/sh failed with exit code 127

So, the things I try to fix these (but not working) are..

1.update pod, try pod install in project folder, try install cocoapods in usr/local/bin 
2.update ruby version by install rvm.
3.try check "Run-script only when installing" under Run-script dropdown, Build Phases tab in XCode

Anyone have any idea about this, this error is gonna making me cry out loud as I spent the whole day with this T-T.

Please help and thanks in advance!

Au
Message has been deleted

Au Viroj Loharatanavisit

unread,
Feb 24, 2016, 6:50:46 AM2/24/16
to Google Mobile Ads SDK Developers

*Add more detail

The project can be built from Unity, 

But the logs show when I try to build and run the project on IPad with XCode.

Veer Arjun Busani

unread,
Feb 24, 2016, 11:35:04 AM2/24/16
to Google Mobile Ads SDK Developers
Hi Au Viroj,

There might be two sides to the issue here. 
  1. Firstly, I want you to ensure that you have having properly implemented the Mobile Ads Plugin for Unity. 
    • Create a new project and import the v 3.0.1 plugin. Then copy over the GoogleMobileAdsDemoScript.cs file from the demo projects and ensure that you have copied over your Ad Unit ID's in the placeholder. Also make sure that you have properly set your Bundle Identifier in your Player Settings. 
    • Then go ahead and build and run it in the Xcode. You can try running this sample project to check if everything works for you. 
  2. If the issue still exists, then it most likely is due to improper pod setup. There might be an issue with references for the pods path to the project. 
    • Try to run - 
    • rm -rf MyProject.xcworkspace
      pod install
  • This would try to reinstall with proper references to the workspace. If this does not work, try to create a new iOS project with CocoaPods just to know which side the issue might lie.
  • You could also look this thread at StackOverflow to try a different approach if none of the suggestions here work.
Thanks,
Veer Busani
Mobile Ads SDK Team
Message has been deleted

Au Viroj Loharatanavisit

unread,
Feb 25, 2016, 3:38:45 AM2/25/16
to Google Mobile Ads SDK Developers
Dear Veer Busani,

Thanks for your help, and here is my feedback about the 2 solution you gave me to try.

1.Actually I just try create new Unity project, and import the Plugin only without attach any demo code to the game object. And try to build into an IPad. Here is the error log it gave me.

/Users/Au/Desktop/xcode/build3/Libraries/Plugins/iOS/GADURewardBasedVideoAd.m

/Users/Au/Desktop/xcode/build3/Libraries/Plugins/iOS/GADURewardBasedVideoAd.m:40:26: No visible @interface for 'GADRewardBasedVideoAd' declares the selector 'loadRequest:withAdUnitID:userID:'

Still have no idea about this, but I will try searching for the reason about this later.

2.As I try to remove xcworkspace and pod install via terminal. The error still the same in both test sample project, and my current project (with different error as I stated above.)

----

After this, I will try to create iOS Project with CocoaPods as you mentioned and will tell you the progress about this later.

FYI, here is my software version I use

Xcode : 7.2.1
Unity3D : 5.3.2 (patch 4)

Thanks!,
Au

Au Viroj Loharatanavisit

unread,
Feb 25, 2016, 4:20:40 AM2/25/16
to Google Mobile Ads SDK Developers
For the error log I found above, I try solving by just comment out 1 line of code in GADURewardBasedVideoAd.m for a temporary just to see it can be build, and it's work.

So, despite the interface error, I guess that in my project it might have some duplicate plugins within that cause unusual error like that (the error code 127).

I think I will try to find the culprit in my project then and will report after I know what cause this.

Au Viroj Loharatanavisit

unread,
Feb 26, 2016, 2:41:18 AM2/26/16
to Google Mobile Ads SDK Developers
Hi Veer Basuni,

OK, Now I fixed my issue, I have to check 

"Run-script only when installing" under Check Pods Manifest.lock dropdown, NOT Run Script dropdown under Build Phases tab (finally!!).

Still, the other error about the interface appear, the same error log I stated above, and I think it might do something about the XCode syntax?

/Users/Au/Desktop/xcode/build3/Libraries/Plugins/iOS/GADURewardBasedVideoAd.m

/Users/Au/Desktop/xcode/build3/Libraries/Plugins/iOS/GADURewardBasedVideoAd.m:40:26: No visible @interface for 'GADRewardBasedVideoAd' declares the selector 'loadRequest:withAdUnitID:userID:'

Do you have any idea about this? the method look like this, I'm not really know why it do the recursive to itself too or am I understanding things wrong ?

- (void)loadRequest:(GADRequest *)request


       withAdUnitID:(NSString *)adUnitID


             userID:(NSString *)userID {


  [self.rewardBasedVideo loadRequest:request withAdUnitID:adUnitID userID:userID]; // <<-- error on this line


}


To solve this for the temporary, I have to comment out the error line, and actually it's work fine for no reason. But I don't know that the ads shown was count and send to the server or not?

Could you give me a feedback about this soon? This is also happens when I import the project to New Unity Project too, I guess it might have something to do with the Xcode version or Unity version?

Thanks!,
Au

Veer Arjun Busani

unread,
Feb 26, 2016, 11:10:37 AM2/26/16
to Google Mobile Ads SDK Developers
Hi Au Viroj,

Thank you for the details. The latest Mobile Ads SDK v7.7 now does not require userID to be passed while loading RewardBasedVideo. A quick fix for now would be to either comment out the RewardVideoAd request if you are not using Reward Based Video Ads. If you are then in the GADURewardBasedVideoAd.m class simply change the following - 

- (void)loadRequest:(GADRequest *)request
       withAdUnitID:(NSString *)adUnitID
             userID:(NSString *)userID {

  [self.rewardBasedVideo loadRequest:request withAdUnitID:adUnitID]; //Remove userID from the request
}

Thanks,
Veer Arjun Busani
Mobile Ads SDK Team

Syed Muhammad Umair

unread,
Aug 25, 2016, 12:30:01 PM8/25/16
to Google Mobile Ads SDK Developers
Hi, Au Viroj
I am able to fix the same issue by checking "run-script only when installing". But the same issue now occurs when I try to archive the build.

Any Solution?
thanks,

Syed Muhammad Umair

unread,
Aug 25, 2016, 12:51:52 PM8/25/16
to Google Mobile Ads SDK Developers
Ah, found the proper solution.

Infact, you don't need to check "Run script only when installing". Actually, if you see the code of the shell script, it contains some dummy placeholder not the actual scipt, which is causing the problem. Simply remove that text and make that empty.
Now, you have fixed the issue.

Thanks,

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 25, 2016, 1:04:38 PM8/25/16
to Google Mobile Ads SDK Developers
Hi Syed,

This has been fixed for a while and you can use the latest v3.0.5 Mobile Ads plugin for Unity.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages