-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null pointer exception when building IOS MainViewController
with simple App
implementation
#3437
Comments
Can you please create a minimal reproducible sample and share it on GitHub ? |
I found that it's caused by adding or removing the SQLDelight plugin Even with no related dependencies, configuration, or code, the exception occurs when the plugin is present. |
I am trying to reproduce it here, but it works as expected Can you please share a minimal reproducible sample on GitHub ? |
@dima-avdeev-jb I have reproduced the problem using your demo. My OS: My JDk: |
Same as @krisbitney, it seems to be caused by |
It might be a Mac OS or Apple cpu issue. I'm not sure if it matters for this, but I'm using:
It seems related to this closed issue: #3386 The closing comment of the closed issue says something that suggests the issue isn't quite fixed for android studio:
Also possibly related: https://stackoverflow.com/questions/76676789/compose-multiplatform-gradle-plugins-build-errors |
Encountered the same issue almost 4 days ago. I think it has to do with mixing and matching the versioning of some of the libraries. I'm using the following: kotlin.version=1.8.21 sqlDelightVersion = 1.5.5 JavaVersion = 17 I'm using cocoapods for the shared folder and using the isStatic = true parameter. I can see in my shared build folder that sqlDelight is working/available in my shared/generated/sqldelight/code folder. hope this helps. P.S. Also using gradle 8.0 |
Any fix regarding this issue? |
I can't reproduce it on my sample project https://github.com/dima-avdeev-jb/sql-delight-compose-mpp-issue Maybe some one else can create a stable reproducible sample project ? |
Also, I made another one sample project with Compose 1.5.10-beta01 here: |
Hi, I ran the above sample and still get the same error.
|
I was just going to try k2 and didn't realise it was outputting real errors:
It looks like val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
dependencies {
implementation(compose.runtime)
}
} only this way: val commonMain by getting {
dependencies {
api(compose.runtime)
// ...
}
} |
@qdsfdhvh How do you running iOS app ? |
I have tested PS: I am able to run the application, however the issue is coming when i run the command
|
@BassirouRabo You can try config |
@dima-avdeev-jb Yes, I run iOS with AndroidStudio and KMM plugin, I can just run ios without going through any changes with sample, this error I only run into when |
@qdsfdhvh Thanks! Yes, it also reproduced with: |
Any fixes for this? I am running into this issue too. |
I used realm sdk instead of sqldelight |
Any updates ? i'm temporarely switching to an alternative to sqldelight but i hope this gets fixed soon ! |
JetBrains/compose-multiplatform#3437 Need to fix with platformLayers = true
Sorry, previous mention in PR was my mistake |
Found this ticket by chance. I was following Philipp Lackner's KMP tutorial. There he used SQLDelight 1.5 which I had to upgrade it to 2.x to work with my Android Studio - After a series of SQLDelight build issues, I ended up seeing this error. Obviously, SQLDelight triggered this issue. I have tried all the suggestions above, |
Hay I have the same problem with kind of the same setup as writing here , I also use coocapods if this has something to do with this , is there any solution to that? |
Hi, is there an update on this issue? |
I also have this error when running |
It's not a fix, but there is a viable workaround:
Isolation was, unfortunately, the only way I found to avoid the exception. |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
2 similar comments
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Can you elaborate or add steps in code not description here. |
Describe the bug
When building, the
MainViewController
for iOS encounters a null pointer exception when attempting to construct anApp
instance.Affected platforms
iOS
Versions
#Versions
My OS: Mac OS Ventura (M1 macbook air)
Target iOS versions: iOS 14.1
Target JVM toolchain: 11
#Android
android.useAndroidX=true
android.compileSdk=33
android.targetSdk=33
android.minSdk=24
Other
kotlin.version=1.9.0
agp.version=8.1.0
compose.version=1.5.0-beta01 (I also got the exception with 1.4.1 and 1.4.3)
To Reproduce
Not sure
Expected behavior
Successful build (hopefully!)
Screenshots
My code:
Additional context
Full stack trace:
npe_error_log.txt
The iOS build has two dependencies: SqlDelight and an xcframework stored locally and configured with cinterop.
The text was updated successfully, but these errors were encountered: