x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

iOS packaging fails with "PhysX" and "APEX" modules

Hello guys,

I'm working on project using PhysX module. But to compile project with "PhysXIncludes.h" and "PhysXSupport.h" headers in my class I also need to add "APEX" module to PublicDependencyModuleNames due to crossdependency in these two headers. This project builds successfully for Android but building for iOS fails.

Repro steps:

  1. Create new blank C++ project;

  2. Add "PhysX" and "APEX" to your PublicDependencyModuleNames array;

  3. Launch or Package for iOS.

Please see attached log:

 LogPlayLevel: mono: Compiling with iPhoneOS SDK 8.4
 LogPlayLevel: mono: Parsing headers for ApexFail
 LogPlayLevel: mono:   
 Running UnrealHeaderTool "/Projects/ApexFail/ApexFail.uproject" "/Projects/ApexFail/Intermediate/Build/IOS/ApexFail/Development/UnrealHeaderTool.manifest"
 -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket
 -installed
 LogPlayLevel: mono: Reflection code generated for ApexFail in 4.6969258 seconds
 LogPlayLevel: mono: Compiling with these architectures: armv7
 LogPlayLevel: mono: Performing 5 actions (8 in parallel)
 LogPlayLevel: mono: [2/5] clang++ ApexFailGameMode.cpp
 LogPlayLevel: mono: [3/5] clang++ ApexFail.cpp
 LogPlayLevel: mono: [1/5] clang++ ApexFail.generated.cpp
 LogPlayLevel: mono: [4/5] clang++ UELinkerFixups.cpp
 LogPlayLevel: mono: In file included from <built-in>:353:
 LogPlayLevel: mono: <command line>:67:9: error: 'WITH_APEX' macro redefined [-Werror,-Wmacro-redefined]
 LogPlayLevel: mono: #define WITH_APEX 1
 LogPlayLevel: mono:         ^
 LogPlayLevel: mono: <command line>:66:9: note: previous definition is here
 LogPlayLevel: mono: #define WITH_APEX 0 LogPlayLevel: mono:        ^
 LogPlayLevel: mono: In file included from <built-in>:353:
 LogPlayLevel: mono: <command line>:67:9: error: 'WITH_APEX' macro redefined [-Werror,-Wmacro-redefined]
 LogPlayLevel: mono: #define WITH_APEX 1
 LogPlayLevel: mono:         ^
 LogPlayLevel: mono: <command line>:66:9: note: previous definition is here
 LogPlayLevel: mono: #define WITH_APEX 0
 LogPlayLevel: mono:        ^
 LogPlayLevel: mono: In file included from <built-in>:353:
 LogPlayLevel: mono: <command line>:67:9: error: 'WITH_APEX' macro redefined [-Werror,-Wmacro-redefined]
 LogPlayLevel: mono: #define WITH_APEX 1
 LogPlayLevel: mono:         ^
 LogPlayLevel: mono: <command line>:66:9: note: previous definition is here
 LogPlayLevel: mono: #define WITH_APEX 0 LogPlayLevel: mono:        ^
 LogPlayLevel: mono: 1 error generated.
 LogPlayLevel: mono: 1 error generated.
 LogPlayLevel: mono: 1 error generated.
 LogPlayLevel: mono:
 -------- End Detailed Actions Stats ----------------------------------------------------------- LogPlayLevel: mono: ERROR: UBT ERROR: Failed to produce item: /Projects/ApexFail/Binaries/IOS/ApexFail
 LogPlayLevel: mono: Total build time:
 20.93 seconds
 LogPlayLevel: CommandUtils.Run: Run: Took 20.991247s to run mono, ExitCode=5
 LogPlayLevel: BuildCommand.Execute: ERROR: BUILD FAILED
 LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception:
Product Version: UE 4.10
Tags:
more ▼

asked Dec 10 '15 at 03:43 PM in Packaging & Deployment

avatar image

Acrossfy
422 14 31 164

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

As Mattew said, APEX is not supported for mobile. It means that if you want to use only PhysX (without APEX) on iOS - you can't cause main Physx headers like "PhysXIncludes.h" and "PhysXSupport.h" are dependent with APEX includes. It will be build for Android, but will fail on iOS. I think that it's very strange and looks like a bug.

In my case I found workaround - I copied all required physx includes in my class with physics and I redefined all required macroses and variables. And now I can compile project and run it on iOS and Android without APEX module.

more ▼

answered Dec 11 '15 at 02:53 PM

avatar image

Acrossfy
422 14 31 164

avatar image Matthew J Dec 11 '15 at 02:56 PM

Try to include PhysXIncludes after these lines of code, it may be a possible workaround for doing so without APEX

 #ifdef WITH_APEX
 #undefine WITH_APEX
 #endif
 #define WITH_APEX 0
avatar image Acrossfy Dec 11 '15 at 03:54 PM

Error: fatal error C1021: invalid preprocessor command 'undefine'

avatar image Matthew J Dec 11 '15 at 04:02 PM

I apologize for the typo, it should be #undef, not #undefine

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hello Acrossfy,

This is an expected error as APEX is not supported for mobile development by UE4 at this time. If you wish to use APEX for mobile development, you'll need to get the APEX source from Nvidia and implement it manually.

Have a nice day!

more ▼

answered Dec 10 '15 at 08:39 PM

avatar image Acrossfy Dec 10 '15 at 10:25 PM

Hello Mattew,

Thank you for your answer. But can you please explain why build for Android with the same module is successful? It looks strange for me.. So I'm not using APEX directly, but when I include "PhysXIncludes.h" it requires APEX module for successful compilation. Without PhysXIncludes I can't use some basic PhysX types which used in BodyInstance for example.

avatar image Acrossfy Dec 10 '15 at 10:53 PM

I'm also need to include PhysXSupport.h which also requires APEX module.

avatar image Acrossfy Jan 11 '16 at 10:33 PM

Hm.. This answer should not be marked as correct because the main question: why it works on Android and doesn't work on iOS? And it is still unanswered.

avatar image Matthew J Jan 12 '16 at 02:00 PM

I didn't realize that I never explained. Although it is working for you on Android, it isn't suppose to and I'm not quite sure why it is. There are settings in the packaging (part of the source code) which Android and iOS should both be setting to disable building APEX.

Have you tried using any APEX features on your Android built project to see if they are working? It may be packaging but disabling it automatically and never using it.

avatar image Acrossfy Jan 20 '16 at 03:54 PM

I didn't try to use APEX features on Android, but I guess that it works on Android exactly as you described. And due to many crossdependecies between PhysX and APEX I think that it's the best solution. So I can package PhysX and APEX (because standard PhysX headers require it) and I will have ability to use buiit-in PhysX header files on Android without any troubles. But on iOS I can't do it the same way. I need to make my own physX headers and redefine standard macroses and variables as I described in my answer. Only after that I can try to use some PhysX features on iOS.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question