I'm using EduTools with Android Studio to build my course, and I chose to create a task of type output.
My main.kt contains this code
fun main() {
print("Hello, world!")
}
and my test/output.txt file contains only this string
Hello, world!
But when I run the solution, it gets an error
Any idea of where I went wrong here?
Android Studio 4.2.2 supports the EduTools plugin version 2021.2.1, which is out of date. I would recommend installing IntelliJ IDEA Edu with a built-in EduTools plugin and test your course there.
Related
I have created a basic KMM by following "Create your first app" guide
https://kotlinlang.org/docs/kmm-create-first-app.html
Then I've tried to build the framework with the following command from Terminal in Android Studio.
./gradlew :shared:embedAndSignAppleFrameworkForXcode
But I'm getting this error.
Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
Android Studio 2020.3.1 Patch 3
Kotlin 1.5.31
There's a similar question on SO. People say that embedAndSignAppleFrameworkForXcode should work with Kotlin 1.5.20 at least.
KMM - Error Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'
But it doesn't in my setup.
Does anyone know how to fix this?
UPDATE
The task is running perfectly fine when launched form XCode/Build Phases script.
Somehow it is not able to launch from terminal (Android Studio or system one).
I think embedAndSignAppleFrameworkForXcode is not supposed to run from the terminal as packForXCode used be.
The proper way to run this task is from XCode build system.
Anyway, I was able to run embedAndSignAppleFrameworkForXcode from terminal after exporting the following variables.
export CONFIGURATION\=Debug
export ARCHS\=x86_64
export EXPANDED_CODE_SIGN_IDENTITY\=-
export FRAMEWORKS_FOLDER_PATH\=iosApp.app/Frameworks
export SDK_NAME\=iphonesimulator15.0
export TARGET_BUILD_DIR\="../build/ios/${CONFIGURATION}-iphonesimulator"
I'm trying to run the demo flutter app through android studio but but whenever I hit run, it says "initializing gradle" on the terminal and never runs the application. I ran the flutter doctor command and it says that there are zero issues so I'm not sure what to do.
Firstly, make sure your Gradle version is above gradle-4.6-all
Then, change this property:
distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
It works!
In gradle-wrapper.properties file make sure distributionUrl is set to your installed gradle version. check your .gradle\wrapper\dists location for your version. make sure you have 4.6 or above.
you need open projectPath/android/gradle/wrapper/gradle-wrapper.properties, find distributionUrl, download gradle file from distributionUrl, move gradle file(don't unzip file) to
C:\Users\.gradle\wrapper\dists\\
I've just installed the latest Android Studio on to a new PC, and tried importing an existing project from my Git repo. However I'm getting the following error:
Error:(91, 0) Could not find method android() for arguments
[build_5rpi8n4wxkti5snnxm1rtlcug$_run_closure7#4154e46b]
on root project 'my_project' of type org.gradle.api.Project.
I've tried updating the module settings to use the latest Gradle version, but that didn't help. Any ideas on what that error means or where to look? I guess the org.gradle.api.Project class is missing an android method, meaning it's the wrong version or something?
Finally fixed this myself! It turns out that Android Studio had added a section to the main build.gradle file that shouldn't be there...
At the bottom of the file was:
android {
/** couple of lines **/
}
Deleting that entire block has fixed my build. I'll leave the question up here, maybe it helps someone else having the same problem.
I have installed Android Studio. When I launch the program, there is the following error.
"Failed to find: com.android.support:appcompat-v7:10.+"
I have checked the SDK manager, Android Support Library and Android are installed.
Maybe my question appears to be stupid but I didn't find any answer.
[EDIT] I changed the
com.android.support:appcompat-v7:10.+
to:
compile 'com.android.support:appcompat-v7:21.0.2'
Now I have more than 400 lines of not found files:
http://pastebin.com/Sa4scRH1
In you build.gradle you have in the dependency section a line containing this string:
compile 'com.android.support:appcompat-v7:10.+'
replace it with this one:
compile 'com.android.support:appcompat-v7:21.0.2'
You are using there a quite old version of the compat library just use the newest one v21.0.2. If this still fails install the support repository from the SDK Manager.
I'm compiling a project that works OK in Eclipse, and builds fine with ant, but in IntelliJ IDEA gives:
Internal groovyc error: code 1
How can I resolve this? Other error messages include:
1:35:46 PM Unknown Natures Detected
Imported projects contain unknown natures:
org.eclipse.jdt.groovy.core.groovyNature
Some settings may be lost after import.
1:43:55 PM Compilation completed with 1 error and 7 warnings in 20 sec
Groovyc: Cannot compile Groovy files: no Groovy library is defined for module
Groovy itself is installed on Linux. Adding it as a groovy compiler in settings does not affect the behavior:
> groovy --version
Groovy Version: 1.7.4 JVM: 1.6.0_24
Apparently you tried to import an Eclipse project into IDEA, and that isn't good enough. (Groovy) Eclipse comes with its own version of Groovy, whereas in IDEA, you have to add groovy-all-1.7.4.jar (or whatever version you want to use) as a compile dependency.
You have to add JAXB dependencies if you are using Groovy 2.5.3 + Java 11 (also check out Java 11 related change). Groovy comes with extra JAXB Jars so we can add them. Open 'Project Structure' dialog, then select 'Dependencies' tab and add the dependencies
Changing the project SDK from Java 15 to Java 8 seemed to have magically fixed the same problem on my machine.
Steps:
Go to File > Project structure... (may differ on Mac/Linux).
Under Project Settings, select Project.
In Project SDK: dropdown, choose a different version of the JDK installed.
Click Apply & OK at the bottom of the dialog.
** Rerun your program.
This worked for me!!
Read the log before the "Internal groovyc error: code 1", then it should show you a groovy version mismatch. Change your groovy version from the dependency list as per the log.
Ex. compile 'org.codehaus.groovy:groovy-all:2.4.11'
Move the Groovy dependency in the module settings to the top right after JDK.
I could make it work just by reestart intellij and invalidate the caches.
It can be found (for intelliJ 2018.1):
File -> Invalidate Caches/restart -> Invalidate and Restart
I found this solution which worked totally for me. You can use this link for fixing this problem
resolving-groovyc-internal-groovyc-error-code-1
I had to reinstall groovy SDK and it started working.
i was use wrong SDK ,please cheak your SDK version