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

code doesn't recognize link classes #219

Open
SavedByZero opened this issue Mar 14, 2022 · 3 comments
Open

code doesn't recognize link classes #219

SavedByZero opened this issue Mar 14, 2022 · 3 comments
Assignees

Comments

@SavedByZero
Copy link

The problem

even with the dependency loaded in the app gradle file, Link classes are "unable to resolve"

Environment

Android Studio 4.1, Windows PC

Steps to Reproduce

-add implementation "com.plaid.link:sdk-core:3.7.1" to app gradle file
-make a java class inside app/src/main
-import classes like:
import com.plaid.link.OpenPlaidLink;
import com.plaid.link.Plaid;
.
-none of them are recognized.

here is my app gradle build file:

`plugins {
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdkVersion 31
buildToolsVersion "30.0.2"

defaultConfig {
    applicationId "com.example.plaidlinkplugin"
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"


}

buildTypes {
    release {
        minifyEnabled false

    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}

}

dependencies {
implementation ("com.plaid.link:sdk-core:3.7.1") {

}

implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}`

and here is my root gradle build file:
`// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.10"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
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()
mavenCentral()
}
}

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

@amytang0
Copy link
Contributor

Hi does this issue repro with our public sample (in this repo)? We have Java classes to ensure compatibility: https://github.com/plaid/plaid-link-android/blob/master/app/src/main/java/com/plaid/linksample/MainActivityStartActivityForResultJava.java

@amytang0 amytang0 self-assigned this Mar 17, 2022
@SavedByZero
Copy link
Author

SavedByZero commented Mar 17, 2022

Correct. I cloned the project as well to make sure, and I get the same unresolved packages without anything being changed. Here's a screen shot of that last class file you linked to. EDIT: It seems to actually happen in the ks files and the Java files, and sometimes it alternates.
image

@SavedByZero SavedByZero changed the title java code doesn't recognize link classes code doesn't recognize link classes Mar 18, 2022
@JeroenMols
Copy link
Contributor

Are you able to build via command line? You can verify that by running ./gradlew assembleDebug.
If that passes, that would indicate this is an Android Studio issue.

To fix the Android Studio issue:

  • Try invalidate caches & restart in Android Studio
  • If that doesn't work, delete the .idea folder in your project
  • If that doesn't work, delete the .gradle folder in your user home: rm -rf ~/.gradle

Hope those steps will help!

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

3 participants