Trouble importing classes from package android.hardware.camera2.impl; - android

I'm new to Android development. I'm having trouble importing from camera2 package.
Here is a screenshot of the failed imports. I don't understand why some of them succeeded while others not.
Really appreciate any help. Thanks in advance.
Edit:
Thanks, but I don't think it's the problem with my minSdkVersion.

The failing imports are internal to Android framework. They are not available to apps. You should be okay if you simply delete all these lines that are marked red. If your code does not compile after such cleanup, post an update with specific error messages.

Related

LeetCode error : Warning : Classpath entry points to a non-existent location:

I'm practicing LeetCode with Kotlin for a few months. Every time I start a new question, I will make some test cases to make sure my understanding is correct to the question.
But today, somehow I see a weird error in LeetCode I have never seen before.
Here is Java code, I got the wrong answer.
Here is Kotlin code, I got the compile error.
I google the error log and find this, and it tells me to update Gradle. But I can't, cause there is no build.gradle file in LeetCode.
Can anyone help me how to solve this problem? Thanks!
It was a bug in the Leetcode's backend itself. Basically some files were missing in the docker image for Kotlin due to which it was happening. Leetcode has fixed the bug and replaced those docker images in their backend. So, it should be good now.
PS: I work at LeetCode.

Cannot resolve symbol SystemService

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.

Eclipse: what is the difference between android-support-v7-appcompat and appcompat_v7?

First off I'm soooooo frustrated trying to get android.appcompat....gridlayout to work. I've followed lots of tutorials and just keep getting that horrible "android.support.v7.widget.GridLayout failed to instantiate" message. So I'm doing some serious detective work to try and understand everything about the compat libraries.
So like the title asks, what is the difference? I'm building the libs/android-...jar files, adding them to the path, following all the directions on https://developer.android.com/tools/support-library/setup.html
Any insight? Should I just uninstall eclipse and start from scratch to try and do this? I'm working with a test project and nothing is working. I keep getting 1 instantiation errors along with an error saying "a resource already exists on disk 'C:......\android-supp..-gridlayout.settings' and '....prefs'.
Please please any insight. Have spent a long time on this. Any advice is much appreciated.
they both refer to the same "v7 appcompat library" discussed at the android developer site.
You cannot just copy the jar file, as this library has resources that are referred to by your project so it needs to be added as a library project with resources as discussed here.

Android Commonsware compile EmPubLite

I am trying to compile EmPubLite tutorials but getting an error concerning the hierarchy of WebViewFragment. Searches only come up with http://commonsware.com/Android/errata but not sure how to resolve this explanation. Many files in this package use WebViewFragment.
Any help would be appreciated.
Thanks in advance,
Terry
Fixed, changed target back to Google API's after incorrectly changing it. Had to delete InstallReceiver.java, had error "The method build() is undefined for the type NotificationCompat.Builder" line 31, on mgr.notify(NOTIFY_ID, builder.build());
Not going to worry about that for now. Any info on it would be great.
I was too focused on one error. Once Mike M. asked for more info on logcat I noticed there was an error with mixed library versions android-support-v4.jar, deleted the one in libs folder and the project compiled fine.

Eclipse show no error in files but in folder

I got this error when code my Android app:
I do nothing to this strings.xml file.
Can anyone fix this error?
I do refresh and clean but nothing change.
Thanks.
As per your Comment. Here i post my answer. For this problem. Try below steps -
First just remove the project from your workspace.
And, after just import that project again into your work-space.
Sometimes, it happened for me. I tried to do this way. It works.
Hope this helps you.
Most Often this happens to me too.
Try to remove project from workspace and re-import it.
Hope it will work :)
It seems you have used localization is your app.
There are different possibilities for the error to occur:
1)You have not localized all of the strings.
2)Other problems are persisting and you are not ignoring them.
Solution:
Right Click on your project----> Java Compiler-----> Errors/Warning---> Remove all errors
let me know if this works.
What version of the SDK are you compiling against? According to this list, you need at least Android 2.3 for Vietnamese localisation.

Categories

Resources