Jitendra
10/15/2023, 1:53 PMCommand PhaseScriptExecution failed with a nonzero exit code
here is the log export variant\=normal
/bin/sh -c /Users/jitendraprajapati/Library/Developer/Xcode/DerivedData/iosApp-ftrrlcszyheexqhbvoqhhryktogx/Build/Intermediates.noindex/Previews/iosApp/Intermediates.noindex/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh
The operation couldn't be completed. Unable to locate a Java Runtime.
Please visit <http://www.java.com> for information on installing Java.
Command PhaseScriptExecution failed with a nonzero exit code
I have java installed, and app is running well from androidStudio, I tried solution mentioned in this link. but no success .Konstantin Tskhovrebov
10/15/2023, 10:31 PMkdoctor -v
output?Jitendra
10/16/2023, 12:07 AMjitendraprajapati@MB-C02HG0G8Q05F ~ % kdoctor -v
Environment diagnose:
[✓] Operation System
➤ Version OS: macOS 14.0
CPU: Apple M1
i You are currently using Rosetta 2.
It may cause some issues while trying to install packages using Homebrew.
Consider switching off Rosetta 2 or ignore this message in case you actually need it.
[✓] Java
➤ Java (openjdk version "17.0.6" 2023-01-17)
Location: /Applications/Android <http://Studio.app/Contents/jbr/Contents/Home/bin/java|Studio.app/Contents/jbr/Contents/Home/bin/java>
➤ JAVA_HOME: /Applications/Android <http://Studio.app/Contents/jbr/Contents/Home|Studio.app/Contents/jbr/Contents/Home>
[✓] Android Studio
➤ Android Studio (AI-223.8836.35.2231.10811636)
Location: /Applications/Android <http://Studio.app|Studio.app>
Bundled Java: openjdk 17.0.6 2023-01-17
Kotlin Plugin: 223-1.9.0-release-358-AS8836.35.2231.10811636
Kotlin Multiplatform Mobile Plugin: 0.8.0(223)-25
i Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.
Gradle JDK can be configured in Android Studio Preferences under Build, Execution, Deployment -> Build Tools -> Gradle section
[✓] Xcode
➤ Xcode (15.0)
Location: /Applications/Xcode.app
[✖] Cocoapods
➤ ruby (ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin23])
✖ System ruby is currently used
CocoaPods is not compatible with system ruby installation on Apple M1 computers.
Please install ruby via Homebrew, rvm, rbenv or other tool and make it default
Detailed information: <https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1/66556339#66556339>
➤ ruby gems (Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
3.0.3.1)
✖ cocoapods not found
Get cocoapods from <https://guides.cocoapods.org/using/getting-started.html#installation>
Recommendations:
➤ IDE doesn't suggest running all tests in file if it contains more than one class
More details: <https://youtrack.jetbrains.com/issue/KTIJ-22078>
Conclusion:
✖ KDoctor has diagnosed one or more problems while checking your environment.
Please check the output for problem description and possible solutions.
Jitendra
10/16/2023, 12:08 AMKonstantin Tskhovrebov
10/16/2023, 5:47 AMJitendra
10/16/2023, 6:42 AM% kdoctor -v -a
Environment diagnose:
[✓] Operation System
➤ Version OS: macOS 14.0
CPU: Apple M1
i You are currently using Rosetta 2.
It may cause some issues while trying to install packages using Homebrew.
Consider switching off Rosetta 2 or ignore this message in case you actually need it.
[✓] Java
➤ Java (openjdk version "17.0.6" 2023-01-17)
Location: /Applications/Android <http://Studio.app/Contents/jbr/Contents/Home/bin/java|Studio.app/Contents/jbr/Contents/Home/bin/java>
➤ JAVA_HOME: /Applications/Android <http://Studio.app/Contents/jbr/Contents/Home|Studio.app/Contents/jbr/Contents/Home>
[✓] Android Studio
➤ Android Studio (AI-223.8836.35.2231.10811636)
Location: /Applications/Android <http://Studio.app|Studio.app>
Bundled Java: openjdk 17.0.6 2023-01-17
Kotlin Plugin: 223-1.9.0-release-358-AS8836.35.2231.10811636
Kotlin Multiplatform Mobile Plugin: 0.8.0(223)-25
i Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.
Gradle JDK can be configured in Android Studio Preferences under Build, Execution, Deployment -> Build Tools -> Gradle section
[✓] Xcode
➤ Xcode (15.0)
Location: /Applications/Xcode.app
[✖] Cocoapods
➤ ruby (ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin23])
✖ System ruby is currently used
CocoaPods is not compatible with system ruby installation on Apple M1 computers.
Please install ruby via Homebrew, rvm, rbenv or other tool and make it default
Detailed information: <https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1/66556339#66556339>
➤ ruby gems (Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
3.0.3.1)
✖ cocoapods not found
Get cocoapods from <https://guides.cocoapods.org/using/getting-started.html#installation>
[✓] Synthetic generated project
➤ Template project build was successful
[✓] Project:
➤ Gradle (8.0)
➤ Gradle plugins:
com.android.application:8.1.1
com.android.library:8.1.1
kotlinx-serialization:null
org.jetbrains.compose:1.5.1
org.jetbrains.kotlin.android:1.9.10
org.jetbrains.kotlin.multiplatform:1.9.10
org.jetbrains.kotlin.plugin.serialization:1.9.0
Recommendations:
➤ IDE doesn't suggest running all tests in file if it contains more than one class
More details: <https://youtrack.jetbrains.com/issue/KTIJ-22078>
Conclusion:
✖ KDoctor has diagnosed one or more problems while checking your environment.
Please check the output for problem description and possible solutions.
Jitendra
10/16/2023, 6:44 AM*cd* "$SRCROOT/.."
./gradlew :shared:embedAndSignAppleFrameworkForXcode
and now build success, Not sure what is the purpose of this scriptKonstantin Tskhovrebov
10/16/2023, 8:29 AMJitendra
10/16/2023, 8:33 AMKonstantin Tskhovrebov
10/16/2023, 11:47 AMJitendra
10/16/2023, 12:23 PMKonstantin Tskhovrebov
10/16/2023, 12:26 PMJitendra
10/16/2023, 12:28 PMKonstantin Tskhovrebov
10/16/2023, 12:33 PMKonstantin Tskhovrebov
10/16/2023, 12:33 PMJitendra
10/16/2023, 1:07 PMJitendra
10/16/2023, 1:12 PM/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh: line 2: cd: "/Users/jitendraprajapati/AndroidStudioProjects/BirdSafari/iosApp/..": No such file or directory
/`build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh: line 3: ./gradlew: No such file or directory`
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/jitendraprajapati/AndroidStudioProjects/BirdSafari/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh (in target 'iosApp' from project 'iosApp')
(1 failure)
Konstantin Tskhovrebov
10/16/2023, 2:04 PM/Users/jitendraprajapati/AndroidStudioProjects/BirdSafari
is it correct path to your project?Jitendra
10/16/2023, 10:19 PMKonstantin Tskhovrebov
10/17/2023, 8:46 AMJitendra
10/17/2023, 9:25 AMERROR: JAVA_HOME is set to an invalid directory: /usr/bin/java
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I also tried by setting this Path to androidStudio bundled one
/Applications/Android\ <http://Studio.app/Contents/jre/Contents/Home|Studio.app/Contents/jre/Contents/Home>
But keep giving same errorTimofey Solonin
10/17/2023, 9:39 AMJAVA_HOME
configuration from custom paths.
Is there any chance you have moved from an intel machine to an M1 recently?Jitendra
10/17/2023, 9:58 AM