Cant import android HDMI package even though it is in master - java

I am trying to use HdmiCecMessage class in my android app, so I installed this dependency in my gradlef file:
dependencies {
implementation 'androidx.hardware:hardware-hdmi:1.0.0'
}
but when I try to import:
import android.hardware.hdmi.HdmiCecMessage;
I get an error I get an error "cannot find symbol HdmiCecMessage".
I saw in google open source that it exsists:
https://android.googlesource.com/platform/frameworks/base/+/9302a73/core/java/android/hardware/hdmi/
any ideas?
thanks

Related

Problem when rebuild project in Android Studio when use Kotlin Class in Java Class

I am a new developer in Android Studio,
My Problem is when building my app using Kotlin Class in MainActivity Class, the error gives me not exists.
MainActivity is Java Code.
Other Classes are some Kotlin and some Java.
The picture below shows the error:
image_url
C:\Users\ammar\AndroidStudioProjects\SPMBot\app\src\main\java\com\infinitytechno\spmbot\MainActivity.java:11: error: package com.infinitytechno.spmbot.background.services does not exist
import com.infinitytechno.spmbot.background.services.Actions;
^
package com.infinitytechno.spmbot.background.services does not exist
if com.infinitytechno.spmbot is your package name, check your project directory, make sure background and services is in the right order .
seems your project has some red error lines, fix them before build them.

Cordova - PluginResult cannot find symbol

I created a small Cordova Plugin added it to my test app.
In plugin.xml I set min cordova version to 3.4.0:
<engines>
<engine name="cordova" version=">=3.4.0"/>
</engines>
In my plugin JAVA class I import the PluginResult package:
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
And I create a "PluginResult" object:
PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
When I build the app I get the error that not found symbol:
error: cannot find symbol PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
error: package PluginResult does not exist
Can anyone help me?
It will be hard to locate the error when you don't post the full source code.
Anyway, the plugin structure requires so many files that your best approach to create a plugin is to use a sample plugin as base.
Check out the cordova-plugin-hello sample, you can download it and start editing everything accordingly to your needs.
After installing the sample plugin, test it by adding this code to your app:
var success = function(message) {
alert(message);
}
var failure = function() {
alert("Error calling Hello Plugin");
}
hello.greet("World", success, failure);
Then, everytime you make a change to the plugin, uninstall and reinstall it into your app to ensure your changes have worked.
I found my mistake ... It's missing an import line:
import org.apache.cordova.PluginResult;

Why i have "error cannot find symbol" when importing some java files that are present in android source?

when i try to add
import android.view.WindowManagerGlobal;
then i receive the error :
error: cannot find symbol
import android.view.WindowManagerGlobal;
^
symbol: class WindowManagerGlobal
location: package android.view
but i see in android source code that the file is present in android/view/WindowManagerGlobal.java
why i can not import it? and as i absolutely need it, how can i import it ?
You need to add it to the classpath. One option is to download the related jar from its github page.
Can you tell us more about your environment?

Build fail on DEMO project using Android suite

I tried to build a demo app of Ad Serving for App developers.
I download Android studio through http://developer.android.com/sdk/index.html .
However, I got a lot error like
Error: (3,19) java: package android.app does not exist
Error: (4,18) java: package android.os does not exist
Error: (5,20) java: package android.view does not exist
Error: (6,25) java: package android.view.View does not exist
Error: (7,20) java: package android.view does not exist
Error: (8,22) java: package android.widget does not exist
.....
I use original code from http://openx.com/product/mobile-ad-serving-for-app-developers/ without doing any modifications.
I tried Android API 19 and 21 Platform through Project Structure but in vain.
It seems the solution is very simple. However, I cannot solve it until now.

java.lang.NoClassDefFoundError: android.support,v4.app.Notification

Following a reboot my Eclipse Android project was damaged, with the vast majority of my import statements being removed. I've managed to recover it using the "Source...Organize Imports" option, but now I get the above error in a previously-working piece of code which uses NotificationCompat.
I found and followed the advice from this question:
Could not find class 'android.app.Notification$Builder
I have import android.support.v4.app.NotificationCompat; at the top of my class, and have both android-support-v4.jar and android-support-v7-appcompat.jar in the lib folder of my project. I still get the error above however.
What else can I try to resolve this?

Categories