Skip to content
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

Unresolved reference: PaperParcelXXX using PaperParcel version 2.04 and kotlin 1.1.61 #207

Open
leshchenko opened this issue Nov 26, 2017 · 8 comments

Comments

@leshchenko
Copy link

I can't build an apk and get this error msg: Error:(12, 33) Unresolved reference: PaperParcelState

PaperParcelState:

@PaperParcel data class State(
            val count: Int,
            val modificationDate: Date
    ) : PaperParcelable {
        @Transient
        val somethingToExclude = 10000L

        companion object {
            @JvmField
            val CREATOR = PaperParcelState.CREATOR
        }
    }

project build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.1.61'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

module build.gradle:

apply plugin: 'kotlin-kapt'

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.ruslan.myapplication"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'nz.bradcampbell:paperparcel:2.0.4'
    implementation 'nz.bradcampbell:paperparcel-kotlin:2.0.4'
    kapt 'nz.bradcampbell:paperparcel-compiler:2.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

Could you please help me resolve this issue?

@grandstaish
Copy link
Owner

I just set up a project with those exact gradle files and it worked :/

Got a reproducible sample I could dl?

@ruslanle
Copy link

Ok, please let me check on another PC.

@leshchenko
Copy link
Author

image
On another PC I got the same problem(

@grandstaish
Copy link
Owner

Others have raised issues like this before too, but I've never been able to reproduce it. If you have a sample project I can look into on github I'll investigate

@leshchenko
Copy link
Author

@grandstaish I created such repo https://github.com/leshchenko/PaperParcelIssue.

@grandstaish
Copy link
Owner

Just downloaded the sample and ran it with no issues.

What's your setup? I'm on a MacBook Pro, Kotlin 1.1.61 (matching plugin), Android Studio 3.0.1 (using the embedded JDK), using the Gradle wrapper in the project.

@leshchenko
Copy link
Author

I used the same configuration but on Linux Mint Sonya.

@Morteza-Rastgoo
Copy link

Same problem on mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants