icerockdev / moko-widgets

Multiplatform UI DSL with screen management in common code for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev
Apache License 2.0
387 stars 32 forks source link

XCode build failed #254

Closed Diy2210 closed 4 years ago

Diy2210 commented 4 years ago

Hi, I run pod install but console show Failure: Build failed Снимок экрана 2020-07-02 в 12 48 41 But Pod installation is complete!

And them Xcode show build failed too: Снимок экрана 2020-07-02 в 12 48 09 Снимок экрана 2020-07-02 в 12 48 53

How I fix it?

Diy2210 commented 4 years ago

I use java: Снимок экрана 2020-07-03 в 10 30 09

And project: Снимок экрана 2020-07-03 в 10 30 27

I try clean cache gradle and pod install again, but I get error too: ERROR: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper Снимок экрана 2020-07-03 в 12 42 00

Alex009 commented 4 years ago

Did I understand correctly that the error occurs in the terminal, but not in IDEA? if you build from IDEA - all work correctly? your case not our project related - it about gradle usage. here details https://github.com/gradle/gradle/issues/12599 Please try to run ./gradlew -version from terminal to check what JDK used by gradle Also more info about problem here - https://github.com/gradle/gradle/issues/10248

Diy2210 commented 4 years ago

Did I understand correctly that the error occurs in the terminal, but not in IDEA? if you build from IDEA - all work correctly? your case not our project related - it about gradle usage. here details gradle/gradle#12599 Please try to run ./gradlew -version from terminal to check what JDK used by gradle Also more info about problem here - gradle/gradle#10248

Error occurs in the terminal when I try pod install My ./gradlew -version dont use. I use the built-in IntelliJ gradle. Снимок экрана 2020-07-07 в 09 41 24

I try use JAVA 8,9,10,11,12,13 but pod install print error.

Alex009 commented 4 years ago

in your project root contained ./gradlew, which used by pod install to compile shared module. call ./gradlew -version not from ~ but from your project root.

Diy2210 commented 4 years ago

in your project root contained ./gradlew, which used by pod install to compile shared module. call ./gradlew -version not from ~ but from your project root.

Oh, I get it=)

Снимок экрана 2020-07-07 в 10 25 53

Alex009 commented 4 years ago

to fix your problem you should change default JVM, which used by gradle, to 1.8

Diy2210 commented 4 years ago

to fix your problem you should change default JVM, which used by gradle, to 1.8

I change JVM to 1.8 and Pod installation complete!, but XCode print error again! Gradle: Снимок экрана 2020-07-13 в 14 56 08

Xcode: Снимок экрана 2020-07-13 в 14 56 58

Снимок экрана 2020-07-13 в 15 37 50

Alex009 commented 4 years ago

congratulations on the progress :) i see xcode print same error as later. i think xcode continue use invalid version of jvm in runs...you can try change build script here: https://github.com/Diy2210/compoza.lite2.moko/blob/master/mpp-library/MultiPlatformLibrary.podspec#L33 for tests just comment 33 line and add "$MPP_PROJECT_ROOT/../gradlew" -version after it do pod install and try to build from xcode - in logs of xcode you got used by xcode version jvm. after it try to change jvm to 1.8...and when gradle output jvm 1.8 from xcode build - rollback change in 33 line of podspec

Diy2210 commented 4 years ago

WOW, its works, if use JVM 1.8, and change 33 line in MultiPlatformLibrary.podspec file! Cool, tnx! I'm happy now! 2020-07-15 Снимок экрана 2020-07-16 в 11 43 49

Alex009 commented 4 years ago

@Diy2210 problem solved? we can close issue?