JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.02k stars 1.1k forks source link

App Store verification fails with "The app references non-public symbols" #3840

Closed sergei-mikhailovskii-idf closed 2 months ago

sergei-mikhailovskii-idf commented 7 months ago

Describe the bug I implemented a library which uses Compose Multiplatform to display logs and added it to the iOS project. It builds fine, but when I upload the app to the App Store, lane fails with the following error:

ERROR: [ContentDelivery.Uploader] Asset validation failed (11) The app references non-public symbols in Payload/AppName.app/AppName: _ubidi_close, _ubidi_getDirection, _ubidi_getLength, _ubidi_getLevelAt, _ubidi_openSized, _ubidi_reorderVisual, _ubidi_setPara, _ubrk_clone, _ubrk_current, _ubrk_first, _ubrk_getRuleStatus, _ubrk_next, _uloc_getDefault, _uloc_toLanguageTag, _uscript_getScript (ID: b685f704-5d49-42c6-b138-5d9237029ac2)

I googled this problem and it seems that there's some problem with SKIA library (https://groups.google.com/g/skia-discuss/c/eY229SYmHbA)

So there's a question - how can I fix this issue? Thanks in advance for the answer!

Affected platforms

Versions

To Reproduce 1) Try to upload the app to the App Store 2) See result

Expected behavior Successfull upload of the IPA to the App Store

Additional context XCode version - 15.0 Here are libs I used

val commonMain by getting {
            dependencies {
                implementation(compose.runtime)
                implementation(compose.material3)
                implementation(compose.materialIconsExtended)
                implementation("io.realm.kotlin:library-base:1.11.0")
                implementation("com.arkivanov.decompose:extensions-compose-jetbrains:2.1.2-compose-experimental")
                implementation("com.arkivanov.decompose:decompose:2.1.2")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
            }
        }
        val androidMain by getting {
            dependencies {
                implementation("androidx.activity:activity-compose:1.8.0")
            }
        }
        val iosSimulatorArm64Main by getting
        val iosMain by getting {
            dependsOn(commonMain)
            iosSimulatorArm64Main.dependsOn(this)
        }
MatkovIvan commented 7 months ago

it seems that there's some problem with SKIA library

Yes, Compose relies on skia library under the hood. SKIA uses ICU library for Unicode support, but it's built with reference to a non-system library.

Is it reproducible on our template project for you? Or is it just about your own project with this set of dependencies?

sergei-mikhailovskii-idf commented 7 months ago

@MatkovIvan thanks for the support, unfortunately I cannot test with the template app, since I cannot upload it to the AppStore and check

dima-avdeev-jb commented 7 months ago

I checked validation process of empty template with Xcode 15 All fine

image
dima-avdeev-jb commented 7 months ago

@sergei-mikhailovskii-idf Can you please check validation in Xcode when building archive?

To do so you need folow these steps:

image image
sergei-mikhailovskii-idf commented 7 months ago

@dima-avdeev-jb hi! I did in the way u described and received the same error after the validation

Screenshot 2023-10-30 at 13 17 37

Here's the failure in logs

Asset validation failed
The app references non-public symbols in Payload/appname.app/appname: _ubidi_close, _ubidi_getDirection, _ubidi_getLength, _ubidi_getLevelAt, _ubidi_openSized, _ubidi_reorderVisual, _ubidi_setPara, _ubrk_clone, _ubrk_current, _ubrk_first, _ubrk_getRuleStatus, _ubrk_next, _uloc_getDefault, _uloc_toLanguageTag, _uscript_getScript (ID: 0f90461d-3a4e-40a5-9b29-c92115d578d1)
2023-10-30 13:14:08.796  INFO: [ContentDelivery.Uploader] 
=============
VERIFY FAILED with 1 error.
=============
dima-avdeev-jb commented 7 months ago

@sergei-mikhailovskii-idf Thanks! It is good, because now we can check your problem without full AppStore publication process.

Can you please provide a minimal reproducible sample of this Issue? You need to remove all sentence(secret) information from your project. Simplify code as much as possible. But bug still needs to appear! And share this project on GitHub. It will help us for better understanding of this Issue.

sergei-mikhailovskii-idf commented 6 months ago

@dima-avdeev-jb sorry for the delay, here's the sample https://github.com/SergeiMikhailovskii/log-view-app

and here's the library which uses compose-multiplatform https://github.com/sergei-mikhailovskii-idf/kmm-debug-view

sergei-mikhailovskii-idf commented 6 months ago

@dima-avdeev-jb hello! any updates here or not yet?

dima-avdeev-jb commented 6 months ago

@sergei-mikhailovskii-idf Sorry, not yet. I will check your samples little bit later

sergei-mikhailovskii-idf commented 6 months ago

@dima-avdeev-jb no problems, it's ok

Kashif-E commented 6 months ago

@sergei-mikhailovskii-idf have you found any solution?

sergei-mikhailovskii-idf commented 6 months ago

@Kashif-E hi! not yet. seems that the issue is in compatibility with some other dependency

xiangning17 commented 6 months ago

having the same issue. @sergei-mikhailovskii-idf Do you mean to confirm that the problem is not with the Compose framework or skia library? It's because of some other dependency of your own.

Kashif-E commented 6 months ago

@xiangning17 i think its some skia dependency

xiangning17 commented 6 months ago

@Kashif-E Thanks for the reply, I also saw the Rect-Native related issue you associated with it, and over there the issue was resolved, but there seems to be no official movement on the Compose side, so is there anything else that can be done at the moment?

I think it's a bit strange, if this is the issue that's causing it to not pass the App Store, then the amount of feedback on the issue shouldn't be so low, or is there actually no one actually using Compose for iOS for development at all yet 😂

sergei-mikhailovskii-idf commented 6 months ago

having the same issue. @sergei-mikhailovskii-idf Do you mean to confirm that the problem is not with the Compose framework or skia library? It's because of some other dependency of your own.

Hi, I think that the problem is in compatability of the Compose and some other dependency

dima-avdeev-jb commented 6 months ago

Sure, I will check sample https://github.com/SergeiMikhailovskii/log-view-app on this week. And try to locally verify it. I hope it helps to find root of the problem

xiangning17 commented 6 months ago

@sergei-mikhailovskii-idf Can you please check validation in Xcode when building archive?

To do so you need folow these steps:

  • Go to Product -> Archive
image
  • Don't use Xcode Cloud and start proccess of Archive again.
  • Wait some time while archiving
  • Choose Validate App
image

@dima-avdeev-jb I select "Validate App" in the third step and it also fine, but when I select "Distribute App" I get an email from Apple telling me the same error message! I hope this helps.

Kashif-E commented 6 months ago

The issue was with Facebook SDK and another analytic sdk that we were using @xiangning17 @sergei-mikhailovskii-idf

xiangning17 commented 6 months ago

The issue was with Facebook SDK and another analytic sdk that we were using @xiangning17 @sergei-mikhailovskii-idf

@Kashif-E Are you saying that you have a Facebook SDK dependency on cocapods in Kotlin Multiplatform that is causing this issue? Or are you saying that you are relying on the Facebook SDK in the Podfile of iosApp? I am locally reducing the dependencies in Kotlin Multiplatform to only compose related ones still reporting the error.

Kashif-E commented 6 months ago

I had the facebook sdk as cocoapod on the native side. After the removal of fb sdk and another analytics sdk the error went away.

dima-avdeev-jb commented 6 months ago

@sergei-mikhailovskii-idf I reproduced the problem. But I have less problems in error description:

image

I will try to solve it

dima-avdeev-jb commented 6 months ago

@sergei-mikhailovskii-idf One of possible solution is to use dynamic frameworks To apply isStatic = false (or simply remove this line) in 2 gradle files:

But in this case was problems with CocoaPods dependencies in your project. Don't know much about this case of usage CocoaPods in Kotlin project.

I will continue research...

dima-avdeev-jb commented 6 months ago

@sergei-mikhailovskii-idf Also, I found that problem disappears after removing pod 'FirebaseDatabase' from iosApp/Podfile even with static=true https://github.com/SergeiMikhailovskii/log-view-app/blob/4f5ff82d45a04a81c7c17b571ae66c84335c31d3/iosApp/Podfile#L9

dima-avdeev-jb commented 6 months ago

Made minial reproducible sample here: https://github.com/dima-avdeev-jb/issue-3840-ios-pods-verification

xiangning17 commented 5 months ago

Hi @dima-avdeev-jb Is there any progress on this issue?

dima-avdeev-jb commented 5 months ago

@xiangning17 For now you can use dynamic framework (isStatic = false in build.gradle.kts, or simple remove this line because it is false by default) Or do not use pod 'FirebaseDatabase'

dima-avdeev-jb commented 5 months ago

@sergei-mikhailovskii-idf Can you please try some of solutions what I mentioned before?

xiangning17 commented 5 months ago

But I depend on other libraries that are static and are required for Firebase integration😂

sergei-mikhailovskii-idf commented 5 months ago

@sergei-mikhailovskii-idf Can you please try some of solutions what I mentioned before?

hello, sorry, didn't find a time yet( I'll try to do it approximately 23-24 December

egorponomaryov commented 4 months ago

I my case this error was caused by pod 'Mixpanel', resolved by replacing it with pod 'Mixpanel-swift'

VertaZoom commented 3 months ago

Is there any workaround for this?

I have isStatic = true set for the framework and the following pods are connected: pod("FirebaseAnalytics") pod("FirebaseCrashlytics") pod("FirebaseRemoteConfig") pod("Sentry")

I get the exact same error after submitting the application for review, there is no way to set isStatic = false since all pods are static

Kashif-E commented 3 months ago

@VertaZoom we are using these pod("FirebaseAnalytics") pod("FirebaseCrashlytics") pod("FirebaseRemoteConfig") and not getting the issue have you tried removing sentry and test?

VertaZoom commented 3 months ago

@Kashif-E Do you build xcFramework and connect it to another existing project and everything works fine?

We release the same application with the same dependencies as a standalone application and build a library for use in other applications.

As a standalone application, the AppStore accepts it and has already published it, but if we build xcFramework and connect it to another application, the AppStore no longer accepts it.

VertaZoom commented 3 months ago

It turned out that in the project with the Compose xcFramework dependency, there was also a Pod 'Intercom' and for some reason they conflicted with each other.

It helped to connect Intercom via SMP, and the Compose library via cocoapods

ahmedsalemelzeiny commented 3 months ago

I’m Currently trying to integrate sendbird in compose Multiplatform project and everything is working fine in debug mode and the functionality is working fine but when trying to upload the build to testflight I got an email from Apple:-

ITMS-90338: Non-public API usage - The app references non-public symbols in AppName - DEV: _ubidi_close, _ubidi_getDirection, _ubidi_getLength, _ubidi_getLevelAt, _ubidi_openSized, _ubidi_reorderVisual, _ubidi_setPara, _ubrk_clone, _ubrk_current, _ubrk_first, _ubrk_getRuleStatus, _ubrk_getRuleStatusVec, _ubrk_isBoundary, _ubrk_last, _ubrk_next, _ubrk_previous, _uloc_getDefault, _uloc_toLanguageTag, _uscript_getScript. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

And after removing sendbird pod it’s working fine, then I used the pod directly in another project without compose Multiplatform and I didn’t get such an issue

dima-avdeev-jb commented 3 months ago

Possible related issue with cocoapods dependencies problem:

RoniSapirstein commented 3 months ago

We are having the same issue, when uploading the build to testflight we are receiving an email from Apple with the following error: Hello, We noticed one or more issues with a recent delivery for the following app: Please correct the following issues and upload a new binary to App Store Connect. ITMS-90338: Non-public API usage - The app references non-public symbols in Nanit: _ubidi_close, _ubidi_getDirection, _ubidi_getLength, _ubidi_getLevelAt, _ubidi_openSized, _ubidi_reorderVisual, _ubidi_setPara, _ubrk_clone, _ubrk_current, _ubrk_first, _ubrk_getRuleStatus, _ubrk_getRuleStatusVec, _ubrk_isBoundary, _ubrk_last, _ubrk_next, _ubrk_previous, _uloc_getDefault, _uloc_toLanguageTag, _uscript_getScript. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.

When I tried to validate the version through xcode as suggested, it was approved.

I've tried just to add Compose dependency one after the other. implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) implementation(compose.ui) @OptIn(ExperimentalComposeLibrary::class) implementation(compose.components.resources) Except of compose.runtime, each of them triggered this email.

I've also tried this: One of possible solution is to use dynamic frameworks To apply isStatic = false (or simply remove this line) and it didn't help.

dima-avdeev-jb commented 3 months ago

@RoniSapirstein What Compose version are you using?

RoniSapirstein commented 3 months ago

compose = "1.5.4" composeCompiler = "1.5.8" composePlugin = "1.5.12"

lital-nanit commented 3 months ago

@dima-avdeev-jb following on @RoniSapirstein's comment, we've also just got rid of all our pods in KMM cocoapods block, but still, same exact error when uploading to the store.

dima-avdeev-jb commented 3 months ago

@lital-nanit What Compose version are you using?

dima-avdeev-jb commented 3 months ago

@ahmedsalemelzeiny @RoniSapirstein @lital-nanit Can you please provide a minimal reproducible sample project?

MatkovIvan commented 2 months ago

Hi there!

We've renamed these symbols in an underlying library to avoid name-conflicts and false-positive "non-public symbols" detection. This fix will be available in 1.6.1. But if you want to try it out now, you can manually replace a skiko library by adding this at the end of build.gradle.kts file:

configurations.all {
    resolutionStrategy.eachDependency {
        if (requested.group.startsWith("org.jetbrains.skiko")) {
            useVersion("0.7.96")
        }
    }
}

Please let us know if this works for you