Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by zach22 · May 19, 2015 at 10:12 AM ·

AppendProject error

using System; using System.IO; using System.Reflection; using System.Collections; using System.Collections.Generic;

using UnityEngine; using UnityEditor; using UnityEditor.Callbacks; using UnityEditor.XCodeEditorChartboost;

namespace ChartboostSDK { public class ChartboostPostProcess : MonoBehaviour {

     [PostProcessBuild(-10)]
     public static void OnPostProcessBuildCleanup(BuildTarget target, string path)
     {
         CBCleanup.Clean();
     }
     
     [PostProcessBuild(5000)]
     public static void OnPostProcessBuild(BuildTarget target, string path)
     {
         if(target == BuildTarget.iOS && !EditorUserBuildSettings.appendProject) {
             PostProcessBuild_iOS(path);
         }
         else if(target == BuildTarget.Android) {
             PostProcessBuild_Android(path);
         }
     }
     
     private static void PostProcessBuild_iOS(string path)
     {
         ProcessXCodeProject(path);
     }
     
     private static void PostProcessBuild_Android(string path)
     {
         // Check for manifest issues
         if (!CBManifest.CheckAndFixManifest())
         {
             // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
             CBManifest.GenerateManifest();
         }
     }
     
     private static void ProcessXCodeProject(string path)
     {
         UnityEditor.XCodeEditorChartboost.XCProject project = new UnityEditor.XCodeEditorChartboost.XCProject(path);

         // Find and run through all projmods files to patch the project
         string projModPath = System.IO.Path.Combine(Application.dataPath, "Chartboost/Editor");
         var files = System.IO.Directory.GetFiles(projModPath, "*.projmods", System.IO.SearchOption.AllDirectories);
         foreach (var file in files)
         {
             project.ApplyMod(file);
         }
         project.Save();
     }
     
     
     
     
 }

}

////////////////////////////////////// ///How do i fix this error about -
if(target == BuildTarget.iOS && !EditorUserBuildSettings.appendProject) /// ///Error on appendProject /// ///This won't work in unity 5.0.1 /////////////////////////////////////

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by ExNinja · Jul 17, 2017 at 10:01 PM

Thanks, @zaid87 for the great answer. It looks like this has now broken again with Unity 2017, but the following code will make it work:

         #if UNITY_5 || UNITY_5_3_OR_NEWER
         if(target == BuildTarget.iOS) {
             PostProcessBuild_iOS(path);
         }
         #else
         // UNITY_4_0 to UNITY_4_6
         if(target == BuildTarget.iPhone && !EditorUserBuildSettings.appendProject) {
             PostProcessBuild_iOS(path);
         }
         #endif
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Abdelfettah · Jun 14, 2021 at 01:33 AM 0
Share

This answer helps me, thank you.

avatar image
1

Answer by zaid87 · Jul 03, 2015 at 08:45 AM

Although this is an old question, I just placed an answer in the case someone else have the same problem (I did at least, and saw this question).

It seems like Chartboost themselves already fixed this issue in their newer SDK version for Unity. Here's some of the code that handles this issue (they checked for Unity version):

 #if UNITY_5
 if(target == BuildTarget.iOS) {
     PostProcessBuild_iOS(path);
 }
 #else
     // UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6
     if(target == BuildTarget.iPhone && !EditorUserBuildSettings.appendProject) {
         PostProcessBuild_iOS(path);
     }
 #endif

Hope this helps someone that run into the same issue as we did.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image itachi1600 · Sep 23, 2019 at 02:54 PM 0
Share

thank you brother

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Exp / Inp Fbx Animated character problems 0 Answers

Unexpected token: targetPos 1 Answer

How to make muzzle flashes for an automatic rifle 1 Answer

Asset store 1 Answer

My player gameobject is ignoring colliders... 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges