plaid-link-android
plaid-link-android copied to clipboard
code doesn't recognize link classes
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 }`
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
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.

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 & restartin Android Studio - If that doesn't work, delete the
.ideafolder in your project - If that doesn't work, delete the
.gradlefolder in your user home:rm -rf ~/.gradle
Hope those steps will help!