I have imported an Google Speech API example from Google.
https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech
It is unable to resolve R.layout
I have cleaned & rebuilt the project
Attempted to change the gradle 4.1 to gradle 2.9. Which it did not
allow me because the minimum gradle required is gradle 4.1
The xml files are from Google, so I assumed they were okay. Still checked them anyway
I also inserted the credential.json inside the project. This is taken from the Google Cloud Platform, if anyone is thinking of using this example. This is very important
The catlog is also giving me this error :
Error:Could not determine the dependencies of task ':app:extractIncludeDebugProto'.
> Resolving configuration 'debugCompile' directly is not allowed
Did anyone have this issue when the trying out this sample code?
Any input is greatly appreciated thanks :)
Problem solved, really stupid really.
Just redownloaded the sample , imported it into Android studio.
changed the gradle 3.0 from the initial stage instead of after
hope this helps :)
Related
I am working on a project that will have a 3D model viewer in one fragment. In order to do so, I decided to use sceneform.
I downloaded sceneform plugin into Adnroid studio, downloaded and extracted sdk from Github, and I also copied libsceneform_runtime_schemas library into my project. I've added to my sceneform buil.gradle file line
implementation files("../libs/libsceneform_runtime_schemas.jar")
but that results in an error:
Program type already present: com.google.ar.schemas.lull.AabbDef
It is worth noticing that this is the first file in the jar under this path - which probably means that there will be more collisions.
If I'd try not to implement this library, then I get an error:
error: package com.google.ar.schemas.sceneform does not exist
I am using ar:core:1.17.0, and minSdkVersion 24 in sceneform gradle.
I've cleaned and rebuilt the project, Invalidate Caches/Restart, and added multiDexEnabled- although I am not sure if I did it correctly.
By using gradlew sceneform:dependencies I didn't find mentioned file.
I don't know how I can move forward, any help is much appreciated. If I can provide additional information, please let me know.
Edit 1:
I've also tried to work with
implementation files("../libs/libsceneform_runtime_schemas.jar"){
exclude ...
}
But I couldn't make it work. I wonder if that could be my solution.
Also, why does it try to implement this class since it already exists? Shouldn't there be some sort of check for that?
I solved my problem by restoring my project from repo to the last moment before including sceneform, and I proceeded with all of the steps again; Gradle dependencies to the libsceneform_runtime_schemas, min java 8, min SDK version, copying scenformscr and sceneformux to my project again, and lastly - upgrading all classes to AndroidX.
After two days almost I couldn't remove the error, and I don't know what went wrong before, but this time it works like a charm.
TL;DR - I removed the sceneform from my project and imported it again.
I am new to Android development, and was wondering why a library like AudioManager (android.media.AudioManager) can be used, but when I try to navigate to the code of AudioManager, half the source code is red.
For example, it says,
cannot resolve symbol SystemService"
Do I need to add some kind of dependency somewhere?
This means that when I debug through AudioManager, the bytecode does not match what appears on the screen and the debug is useless.
I've tried looking at other posts and changing my SDK version to 27 and my minimum version up to 23.
Thanks in advance.
This seems to be an IDE error, typically when I am getting build errors caused by this, Invalidate Caches and Restart will fix this. You can find it by searching in the help menu or under File in Android Studio
You could try below points as it worked-out for it :
Exit Android Studio
Back up your project
Delete all the .iml files and the .idea folder
Relaunch Android Studio and reimport your project
By the way, the error messages you see in the Project Structure dialog are bogus for the most part.
try to update your Android studio, they always working for something like this. I recommend AS 3.3
Thanks to all for trying to answer. I found the answer to my question here: The import android.os.ServiceManager cannot be resolved.
Explanation:
Apparently the reason AudioManager had so many reds is because it depends on many "hidden" classes, that are purposely excluded from the .jar libraries. The #hide in https://github.com/commaai/android_frameworks_base/blob/master/media/java/android/media/IAudioService.aidl is one example.
I'm stuck in my first real-time firebase app. :(
I was making a simple registration app using firebase and but I found a runtime error . please
remember I'm using android-studio 2.3.
Note- I've included google-services.json also in the required directory.
Error is
My project-level gradle file is
Note:- I think this problem might be----> "due to my sdk manager .but I dont'know how I check which sdk files are required for android studio 2.3 working with firebase".
or,
My app-level gradle file also may contain wrong firebase-auth /firebase-core dependency. please check it below in picture:-
Please guide me with pictorial way because this problem is not explained anywhere with a right solution.
Thanks in advance :)
I'm trying to update the fresco library to the latest version (0.14.1) in the build.gradle file as per the instructions specified by the official website.
It worked when I used earlier version but can't update to the new one.
Below is the error message.
Error:Could not find com.facebook.fresco:fresco:0.14.1.
Required by:
Coupon:app:unspecified
Search in build.gradle files
I've invalidated and cached the Android Studio. I've re-build and cleand the project number of times. It is of no use.
Edit: 0.14.1 should now work.
Previous answer:
Please use 0.14.0 for now. 0.14.1 will be available shortly, we're still in the process of publishing the update.
I had the same issue, after banging my head for hours I realised that was caused by proguard configuration, I copied the most up to date rules from here and it dissappeared.
I am trying to migrate a project that was previously developed in Eclipse over to Android Studio. The way the project was structured had caused a ton of issues when first importing. Most of those have been resolved, however there is one that persists.
The project uses zXing, which itself is a module in the project. There is no issue when referencing the module in code, autocomplete recognizes the library and features inside of it, but when Gradle tries to build I get this error:
error: package Intents does not exist
I've searched for similar scenarios but have not been able to find anything useful. This post is almost exactly what I'm dealing with. Any additional suggestions and advice would be greatly appreciated!
Looking into the build.gradle for the zXing library, changing 'minifyEnabled' from true to false seems to fix the issue.