I'm currently trying to add Firebase to an older android application, to update GCM which is becoming deprecated.
For some reason this project only has one build.gradle file in the project.
I've attempted to add Firebase following googles steps for "Add Firebase to your Android App".
However, when I add the firebase-core, when syncing I continually receive an error:
Failed to resolve: com.google.firebase:firebase-core:16.0.1
I've attempted to follow the instructions here, to no avail.
My project structure looks very similar as the one mentioned here. I'll be happy to provide any other information that may be necessary
How can I get Firebase working on this Android project, that only has 1 build.gradle?
build.gradle:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.0.2'
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
apply plugin: 'com.android.application'
dependencies {
implementation files('libs/GoogleAnalyticsServicesAndroid_3.01/libGoogleAnalyticsServices.jar')
implementation files('libs/aws-android-sdk-2.1.7-sns.jar')
implementation files('libs/aws-android-sdk-2.1.7-core.jar')
implementation "com.google.android.gms:play-services:6.5.87"
implementation 'com.google.firebase:firebase-core:16.0.1'
}
android {
compileSdkVersion = 22
buildToolsVersion = '27.0.3'
defaultConfig {
applicationId "app.name.here"
minSdkVersion 18
targetSdkVersion 22
versionCode 45
versionName "2.8.2"
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
//instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
apply plugin: 'com.google.gms.google-services'