arichornlover / uYouEnhanced

uYouEnhanced (by @arichornlover) is an expanded version of uYou+ (made by @qnblackcat) with additional features and mainly made for non jailbroken users!
https://github.com/arichornlover/YouTubeRebornPlus/
2.32k stars 3.55k forks source link

[Bug] [FIXED] LibColorPicker & CydiaSubstrate Error #660

Closed Mukul1127 closed 5 months ago

Mukul1127 commented 5 months ago

Is there an existing issue for this?

Have you read the Wiki?

Describe the bug

Whenever I try to build uYouEnhanced with any 17.x.x sdk (I used 17.0.3) I get this error:

In file included from <module-includes>:1:
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/lib/iphone/rootless/CydiaSubstrate.framework/Headers/CydiaSubstrate.h:45:1: error: import of C++ module 'MachO.nlist' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]
#include <mach-o/nlist.h>
^
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/lib/iphone/rootless/CydiaSubstrate.framework/Headers/CydiaSubstrate.h:43:1: note: extern "C" language linkage specification begins here
extern "C" {
^
In file included from Sources/BigYTMiniPlayer.xm:1:
In file included from /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/Sources/BigYTMiniPlayer.h:1:
In file included from /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/Sources/uYouPlus.h:8:
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/include/substrate.h:1:10: fatal error: could not build module 'CydiaSubstrate'
#include <CydiaSubstrate/CydiaSubstrate.h>
 ~~~~~~~~^
2 errors generated.
gmake[3]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/rules.mk:405: /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/BigYTMiniPlayer.xm.41f78b36.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
While building module 'CydiaSubstrate' imported from /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/include/substrate.h:1:
==> Compiling Sources/LowContrastMode.xm (arm64)…
In file included from <module-includes>:1:
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/lib/iphone/rootless/CydiaSubstrate.framework/Headers/CydiaSubstrate.h:45:1: error: import of C++ module 'MachO.nlist' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]
#include <mach-o/nlist.h>
^
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/lib/iphone/rootless/CydiaSubstrate.framework/Headers/CydiaSubstrate.h:43:1: note: extern "C" language linkage specification begins here
extern "C" {
^
In file included from Sources/LowContrastMode.xm:1:
In file included from /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/Sources/uYouPlus.h:8:
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/include/substrate.h:1:10: fatal error: could not build module 'CydiaSubstrate'
#include <CydiaSubstrate/CydiaSubstrate.h>
 ~~~~~~~~^
2 errors generated.
gmake[3]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/rules.mk:405: /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/LowContrastMode.xm.41f78b36.o] Error 1
While building module 'CydiaSubstrate' imported from /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/include/substrate.h:1:
==> Compiling Sources/uYouPlus.xm (arm64)…
rm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/uYouPlusSettings.xm.mm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/uYouPlusPatches.xm.mm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/LowContrastMode.xm.mm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/BigYTMiniPlayer.xm.mm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/uYouPlusVersionSpoofer.xm.mm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/uYouPlusThemes.xm.mm /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/YTReExplore.x.m /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/uYouPlus.xm.mm
In file included from <module-includes>:1:
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/lib/iphone/rootless/CydiaSubstrate.framework/Headers/CydiaSubstrate.h:45:1: error: import of C++ module 'MachO.nlist' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]
#include <mach-o/nlist.h>
^
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/lib/iphone/rootless/CydiaSubstrate.framework/Headers/CydiaSubstrate.h:43:1: note: extern "C" language linkage specification begins here
extern "C" {
^
In file included from Sources/uYouPlus.xm:1:
In file included from /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/Sources/uYouPlus.h:8:
/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/vendor/include/substrate.h:1:10: fatal error: could not build module 'CydiaSubstrate'
#include <CydiaSubstrate/CydiaSubstrate.h>
 ~~~~~~~~^
2 errors generated.
gmake[3]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/rules.mk:405: /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/Sources/uYouPlus.xm.41f78b36.o] Error 1
gmake[2]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/library.mk:52: /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/uYouEnhanced.dylib] Error 2
gmake[1]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/library.mk:37: internal-library-all_] Error 2
gmake: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/master/rules.mk:146: uYouEnhanced.all.tweak.variables] Error 2
Error: Process completed with exit code 2.

Steps to reproduce the issue

  1. Build the repo with any 17.x.x SDK (I used 17.0.3) (I'm Using 17.x.x SDK as 16.x.x SDK causes libcolorpicker to fail to link for me, tried 16.4 from your repo, 16.4 from upstream iOS-SDK, and 16.5 from theos repo)
    ==> Linking library libcolorpicker (arm64)…
    ld: warning: ignoring duplicate libraries: '-lc++'
    ld: warning: search path '/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/install/Library/Frameworks' not found
    ld: warning: search path '/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/install/var/jb/Library/Frameworks' not found
    ld: framework 'Preferences' not found
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[5]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/library.mk:52: /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/libcolorpicker.dylib] Error 1
    gmake[4]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/library.mk:52: /Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/main/.theos/obj/arm64/libcolorpicker.dylib] Error 2
    gmake[3]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/instance/library.mk:37: internal-library-all_] Error 2
    gmake[2]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/master/rules.mk:146: libcolorpicker.all.library.variables] Error 2
    gmake[1]: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/master/aggregate.mk:12: internal-all] Error 2
    gmake: *** [/Users/runner/work/uYouEnhancedBuild/uYouEnhancedBuild/theos/makefiles/master/aggregate.mk:12: internal-all] Error 2
    Error: Process completed with exit code 2.
arichornlover commented 5 months ago

Something in the newer iOS SDKs have that weird problem. None of us have really thought about resolving it. Maybe It can be resolved. I’ll see what I could do.

arichornlover commented 5 months ago

Also which 16.x.x SDK are you referring? I know that 16.5 and older SDKs work normally. Are you using a newer iOS 16 SDK to cause the libcolorpicker problem?

Mukul1127 commented 5 months ago

Also it seems this is caused by Theos-jailed as it uses CydiaSubstrate, but why do we need it, Theos seems to natively support packaging ipas: https://theos.dev/docs/packaging Edit: I figured out that Theos can build ipas from source, not modify them.

arichornlover commented 5 months ago

Try removing Theos-jailed from the compiler and see if the results change. I never really knew why Theos-jailed was needed but it would probably be important for something

Mukul1127 commented 5 months ago

This may be promising: https://github.com/kabiroberai/theos-jailed/pull/71, EDIT: made a repo with the changes here: https://github.com/Mukul1127/theos-jailed, EDIT 2: It also failed

Mukul1127 commented 5 months ago

I managed to fix the libcolorpicker link failure with help from the nice people in the Alderis github: https://github.com/hbang/Alderis/issues/28