Not Showing Developer Services in Project Structure.
Hi currently i am working with
GoogleFirebase
and i successfully added my project with firebase but problem comes when i need to add the dependency for firebase client but when i open my File->project Structure i am getting this type pf project structure.
MyProject Strcuture
I am not able to add the dependency for firebase client.
This is my
build.gardle(Project)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.1'
// 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
}
This is my
build.gardle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.amk52.mymusic"
minSdkVersion 21
targetSdkVersion 27
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 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.firebaseui:firebase-ui:4.0.1'
}
apply plugin: 'com.google.gms.google-services'
How should i resolve my problem?
It's because you are trying to show the window from Files > Project Structure which it doesn't related to current project i suppose.
Instead, if you already added the dependencies of Firebase and Build was successful, go through Right click on the project, Open module Settings and then you should be able to see the Developer Services:
The developer services has been removed from Android Studio 2.2 and above and this is the link about this;
https://stackoverflow.com/a/37704210/4409113
Use Tools > Firebase
Related
When I added the dependencies as told in the firebase guide and sync the project ,I get the error JAVA__LETTER_OR_DIGIT .I work with MAC OS X Yosemite and my android studio version is 3.1.4
My app grade file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "e.apple.mse_project"
minSdkVersion 22
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 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
My project grade file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.3.2'
// 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
}
This is the error that I get in the build console
The error log that shows in my build console
Thanks in advance !
The problem is with Android gradle plugin which doesn't work well with Google's Maven repository.
You can downgrade your google-services down to 4.2.0 as it was said by #mownathi-manigundan. Version 4.2.0 is available in AndroidTools Repository which outdated gradle plugin handles just fine
But it'd be better to update your plugin up to 3.2 or higher and use recommended com.google.gms:google-services:4.3.2. You can read more here how to to this
Try changing your version of gms google service in your project gradle as com.google.gms:google-services:4.2.0
I'm trying to use pocketsphinx in my android app and its giving me trouble. I've installed it as outlined here: PocketSphinx on Android, specifically by importing the .aar. Here is my code:
project build.gradle file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.android.tools.build:gradle:3.2.1'
//classpath 'com.google.gms:google-services:4.0.1'
// 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
Application build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "kutz.connor.Aware"
minSdkVersion 26
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'
}
DexOptions {
matchingFallbacks = ['debug', 'release']
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'org.tensorflow:tensorflow-lite:+'
implementation project(':aars')
}
apply plugin: 'com.google.gms.google-services'
And the error I get is
ERROR: Unable to resolve dependency for ':Aware#debug/compileClasspath': Could not resolve project :aars.
ERROR: Unable to resolve dependency for ':Aware#debugAndroidTest/compileClasspath': Could not resolve project :aars.
ERROR: Unable to resolve dependency for ':Aware#debugUnitTest/compileClasspath': Could not resolve project :aars.
when I try to build the project. Upon research I've seen that this probably has to do with updating Androdi Studio to 3.0.
Some solutions I have tried:
Adding matchingFallbacks for debug, release in the build.gradle function
Creating a settings.gradle for the project
Any help would be great. I've seen on posts to move all buildtypes to the app gradle as well but I'm unsure of exactly how to do that.
EDIT
Here is the settings.gradle file in the project folder, it has only one line
include ':Aware', ':aars'
I have seen some similar questions related to this error. But I wasn't able to solve the problem. I am using firebase ml kit to recognize text from an image. I have added the google-services.json file to the app directory, but still, I got the same error. If anyone can solve this issue please let me know.
I have got the following error:
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
E:\Practices\Android Projects\2019\DataFactor\app\src\nullnull\debug\google-services.json
E:\Practices\Android Projects\2019\DataFactor\app\src\debug\nullnull\google-services.json
E:\Practices\Android Projects\2019\DataFactor\app\src\nullnull\google-services.json
E:\Practices\Android Projects\2019\DataFactor\app\src\debug\google-services.json
E:\Practices\Android Projects\2019\DataFactor\app\src\nullnullDebug\google-services.json
E:\Practices\Android Projects\2019\DataFactor\app\google-services.json
My build.gradle for project :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.0.1'
// 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
}
My build.gradle for app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "app.shakil.com.datafactor"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.+'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-ml-vision:19.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
This question was answered by (I presume) the original poster:
"Yeah i found the answer.I misplaced the json file.Try to put the json file in the right directory. I just moved the json file from project level to app level. – Sakhawat Hossain Oct 22 '19 at 9:30".
I am trying to connect my android project to firebase. It was working also properly in starting. I don't know what happened all by sudden i am got series of Unresolved dependencies.
I have done almost all steps which I found over web. Like disable offline work, Invalidate chache/restart. Even when I am creating new project I am facing same problem. Earlier this all things were not happening.
My application gradle code is :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
maven { url "http://jcenter.bintray.com"}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle for module
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.aabsys.metasensing"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "2.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'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
}
apply plugin: 'com.google.gms.google-services'
Thanks in advance.Please find image
Try adding the following dependency in your code:-
implementation 'com.google.android.gms:play-services:12.0.1'
If it still does not resolve your issue, try updating Google play services and Google repository.
Try to change the class path
classpath 'com.google.gms:google-services:4.2.0'
I solved my issue by reducing google service version to :
classpath 'com.google.gms:google-services:4.0.0'
And removing
implementation 'com.google.firebase:firebase-core:16.0.1'
I'm trying to sync with Firebase with my project I use the tool from Android Studio --> Firebase and then I do the steps (This is new Project) Image.
Android Studio version 3.0.1
The build.gradle in App folder is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.eranp.fiberbase"
minSdkVersion 19
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 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.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'
}
apply plugin: 'com.google.gms.google-services'
The build.gradle in Project folder
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
compile "com.android.support:support-core-utils:27.1.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
But when I sync the project I have this Error:
Error:(13, 0) Could not find method compile() for arguments
[com.android.support:support-core-utils:27.1.0] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Please install the Android Support Repository from the Android SDK
Manager.
But this is installed: Image.
I tried for a week to work with Firebase but anything working to sync.
How can I fix this?
thank you for helping!
After you add this:
compile "com.android.support:support-core-utils:27.1.0"
under the dependencies in the app/build.gradle
then you need to change the:
compileSdkVersion 26
to this:
compileSdkVersion 27
also update the firebase version to this:
implementation 'com.google.firebase:firebase-database:11.8.0'
latest version
You're trying to add a compile dependency to your project buildscript, which is not valid. You are only supposed to add classpath dependencies to your buildscript, which effectively act as plugins for your Gradle build.
compile dependencies are to be using your app's build.gradle, which typically lives in the app folder. These are SDK components that you use to build your app.
If you want to use compile "com.android.support:support-core-utils:27.1.0" in your app, move it from the buildscript dependencies to the app dependencies.