Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- Tried the following constructors but they failed to match:
- User(int,java.lang.String) : [arg0 : null, arg1 : null]
- User(java.lang.String) : [arg0 : null]
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- Tried the following constructors but they failed to match:
- Training(long,java.lang.String,java.util.List<com.caiquebrito.monteseutreino.data.model.TrainingJson>) : [arg0 : null, arg1 : null, arg2 : null]
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- Tried the following constructors but they failed to match:
- User(int,java.lang.String) : [arg0 : null, arg1 : null]
- User(java.lang.String) : [arg0 : null]
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- Tried the following constructors but they failed to match:
- Training(long,java.lang.String,java.util.List<com.caiquebrito.monteseutreino.data.model.TrainingJson>) : [arg0 : null, arg1 : null, arg2 : null]
- error: Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
- 10 errors
- @Entity(tableName = "user")
- data class User(
- @PrimaryKey(autoGenerate = false)
- var uid: Int = 1,
- @ColumnInfo(name = "user_name")
- var name: String
- ) {
- constructor(name: String): this(1, name)
- }
- @Entity(tableName = "training")
- data class Training(
- @PrimaryKey(autoGenerate = true)
- var uid: Long,
- var title: String,
- @Embedded
- var trainingsList: List<TrainingJson>
- )
- @Entity(tableName = "trainingjson", foreignKeys = arrayOf(ForeignKey(entity = Training::class,
- parentColumns = arrayOf("uid"),
- childColumns = arrayOf("trainingId"),
- onDelete = ForeignKey.CASCADE)),
- indices = arrayOf(Index(value = "trainingId")))
- data class TrainingJson(
- @PrimaryKey(autoGenerate = true)
- var uid: Long,
- var trainingId: Long,
- var title: String,
- var value: String) : Parcelable {
- constructor(): this(0, 0, "", "")
- constructor(source: Parcel): this(source.readLong(), source.readLong(), source.readString(), source.readString())
- override fun describeContents(): Int {
- return 0
- }
- override fun writeToParcel(dest: Parcel, flags: Int) {
- dest.writeLong(this.uid)
- dest.writeLong(this.trainingId)
- dest.writeString(this.title)
- dest.writeString(this.value)
- }
- companion object {
- @JvmField val CREATOR: Parcelable.Creator<TrainingJson> = object : Parcelable.Creator<TrainingJson> {
- override fun createFromParcel(source: Parcel): TrainingJson {
- return TrainingJson(source)
- }
- override fun newArray(size: Int): Array<TrainingJson?> {
- return arrayOfNulls(size)
- }
- }
- }
- }
- apply plugin: 'com.android.application'
- apply plugin: 'kotlin-android'
- apply plugin: 'kotlin-android-extensions'
- android {
- compileSdkVersion 25
- buildToolsVersion '25.0.3'
- defaultConfig {
- applicationId "com.caiquebrito.monteseutreino"
- minSdkVersion 16
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- }
- dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile 'com.android.support:appcompat-v7:25.3.1'
- compile 'com.android.support:cardview-v7:25.3.1'
- compile 'com.android.support:design:25.3.1'
- compile 'com.android.support:recyclerview-v7:25.3.1'
- compile 'com.android.support:percent:25.3.1'
- compile 'com.google.code.gson:gson:2.8.0'
- compile "android.arch.persistence.room:runtime:$room_version"
- kapt "android.arch.persistence.room:compiler:$room_version"
- compile "org.jetbrains.anko:anko-sdk15:$anko_version"
- compile "org.jetbrains.anko:anko-support-v4:$anko_version"
- compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
- testCompile 'junit:junit:4.12'
- compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
- }
- repositories {
- mavenCentral()
- }
- buildscript {
- ext.kotlin_version = '1.1.3-2'
- ext.gradle_version = '3.0.0-alpha6'
- ext.anko_version = '0.9.1'
- ext.room_version = '1.0.0-alpha5'
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
- }
- allprojects {
- repositories {
- jcenter()
- maven { url 'https://maven.google.com' }
- }
- }
- task clean(type: Delete) {
- delete rootProject.buildDir
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement