-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Including kotlin file into App_Resources/Android/src/main/java seems to not work #1682
Comments
Can u try adding the following to the app.gradle project.ext {
useKotlin = "true"
} |
Tried that and also in before-plugins.gradle but nothing works, the file is ignored even if it has syntax errors when built. Do you have an example of a working project using kotlin that way? (without using a plugin but using kotlin file directly in App_Resources/Android...) |
should be the way. Did you clean after adding it? |
Did it and nothing changed, here is my graddle, it compiles but ignores Kotlin files (even with syntax error). // Add your native dependencies here:
// Uncomment to add recyclerview-v7 dependency
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
}
// If you want to add something to be applied before applying plugins' include.gradle files
// e.g. project.ext.googlePlayServicesVersion = "15.0.1"
// create a file named before-plugins.gradle in the current directory and place it there
android {
defaultConfig {
minSdkVersion 19
generatedDensities = []
multiDexEnabled true
}
packagingOptions {
pickFirst '**/*.so'
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
project.ext {
useKotlin = "true"
} |
@darkyelox you will need to create a useKotlin=true |
@triniwiz I actually don't think the gradle.properties gets picked up in App_Resources. I had to make a hook to merge the platform one with the one I would put in App_Resources |
Confirmed that this worked (for someone else) on Discord! |
@shirakaba awesome ! |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
I'm trying to use a Kotlin file with some function for include into my Angular project but everything about it is undefined, for example if I define my packages as org.acrapp then acrapp is undefined and so on.
But if I create a Test.java file with a class inside and package org.acrapp the package isn't undefined anymore but everything from the Kotlin file is undefined (no classes no functions, etc)
To Reproduce
This is what I'm trying to do:
I noticed that if the Kotlin file has an syntax error the CLI stars an Android build but no error is thrown, is like it is ignoring my Kotlin file (Java files are compiled as expected)
Expected behavior
I was expecting that Kotlin was enabled by default for use in App_resources, if that isn't the case have I do enable it? how?
Additional context
Running on Genymotion with Android 10
The text was updated successfully, but these errors were encountered: