Hi all, Im new to android development and going th...
# getting-started
d
Hi all, Im new to android development and going through this tutorial and getting hung up on this step
Copy code
sqldelight {
    database("AppDatabase") {
        packageName = "com.jetbrains.handson.kmm.shared.cache"
    }
}
while using Android studio, I’m not able to create a package like that, but directory instead, that looks like this.
Copy code
sqldelight {
    database("AppDatabase") {
        packageName = "com.example.ktorSQLDelight.shared.commonMain.sqldelight.shared.cache"
//      packageName = "com.example.shared.cache"
    }
}
i called this project ktorSQLDelight, i tried the above, but my AppDatabase is never “found” by the rest of the app.
h
Do you really use this name (path) as your package name? The package name is used for , well, the package name of the generated files, not the path to your sq files. Just check
build/generated/sqldelight
d
nothing built yet so i could have a build
h
You are not able to execute the sqldelight gradle tasks?
d
I’m not sure what that means yet
h
Do you know Gradle or is it new to you too? :)
d
I’m new to it also
essentially if i try to run the app, it complains about the AppDatabase not being defined where its used
h
So on the right side, you have a list of the available Gradle task. Even if the AppDatabase is not found by the Kotlin compiler, you should be able to execute the sqldelight task to generate the db. Or get the error message
d
i may have to configure something to show those tasks
i wonder too why i can’t create a package, i created the directory sqldelight instructed by the tutorial but dont have an option to create a package like they suggest
h
A package is just a folder, nothing special. Only android studio/intellij and other IDEs shows multiple folder as flat package: => com.example is com/example
👍 1
Don't know, why the gradle task list does not work, but at the end, it also works without the ui, by using the terminal
./gradlew generateSqlDelightInterface
d
Ok so the build was successful with that command, but nothing changed on the right side “gradle” tasks
h
I guess, this is related to this new option: https://stackoverflow.com/a/55217231