Gradle Dependancies in Android 3.1.3
If you want to use the latest versions of the libraries, here what you must do.
compile is going to be replaced with implementation soon. Compiler gives warnings regarding that so you should change it.
Testing-only dependancies should be changed from androidTestCompile to androidTestImplementation
com.google.android.gms:play-services-appindexing:x.x.x is obsolete as it is replaced with com.google.firebase:firebase-appindexing:x.x.x where x.x.x is the version you need.
Here is a changed version that uses the latest libraries. Anything with the $ in it is a String value that you can change if a new version comes out for those.
`dependencies {
def espresso_version = "3.0.2"
def android_support_version = "27.1.1"
def android_support_test_version = "1.0.2"
def firebase_version = "16.0.1"
implementation "com.android.support:design:$android_support_version"
implementation "com.android.support:support-annotations:$android_support_version"
implementation "com.google.firebase:firebase-appindexing:$firebase_version"
implementation "com.android.support.test.espresso:espresso-idling-resource:$espresso_version"
// Testing-only dependencies
androidTestImplementation "com.android.support:support-annotations:$android_support_version"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_version"
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espresso_version"
androidTestImplementation "com.android.support.test:rules:$android_support_test_version"
androidTestImplementation "com.android.support.test:runner:$android_support_test_version"
}`
Change compileSdkVersion 25 to compileSdkVersion 27
The static imports would be highlighted in red on the InstrumentedTest java files. Just delete the static imports and add each one. Can alt + enter on items you have your cursor on that are needing imports.
I tried the above, and it did solve some "cannot resolve" problems when using build:gradle:3.1.3 , but I still consistently get "cannot resolve symbol IdlingResource". If I try to import android.support.test.espress.IdlingResource, it says "cannot resolve symbol IdlingResource". Tried all the usual invalidating caches, cleaning project, rebuilding project, shutting down AndroidStudio and restarting it again. Time to move on after spending 12 hours trying to get this to build in AndroidStudio.
As of today, the StarterCode builds & runs for me with this build.gradle (app) which uses all the newest versions:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.android.teatime"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api 'com.android.support:design:28.0.0'
api 'com.android.support:support-annotations:28.0.0'
api ('com.google.firebase:firebase-appindexing:17.1.0') {
exclude group: 'com.android.support', module: 'support-media-compat'
exclude group: 'com.android.support', module: 'support-v4'
}
}
I won't go to the trouble of a pull request since it seems this repo isn't being maintained anyway.
Gradle sync failed: Unsupported method: SyncIssue.getMultiLineMessage(). (Android Studio)
https://stackoverflow.com/questions/64409047/gradle-sync-failed-unsupported-method-syncissue-getmultilinemessage-androi