I need to create an image in my application's sub-folder so that I am using java.io.File and java.io.FileOutputStream; but when I build the project , this error occurs :
error: cannot find symbol
[javac]java.io.File
error: cannot find symbol
[javac] import java.io.FileOutputStream;
How can I fix this or there is an another way to create the file?
Import microedition, eg,
import javax.microedition.io.file.FileConnection;
Related
I opened up my project and compiled and ran it, and I'm getting the error mentioned in the title, error: cannot find symbol class ComputableLiveData. I've built a local database using a Room abstraction over SQLite, and the error is occurring in BundleDao_Impl.java.
package com.weaberlumber.programmer.s4s_scan;
import android.arch.lifecycle.ComputableLiveData; //The error is here
import android.arch.lifecycle.LiveData;
import android.arch.persistence.db.SupportSQLiteStatement;
import android.arch.persistence.room.EntityDeletionOrUpdateAdapter;
import android.arch.persistence.room.EntityInsertionAdapter;
import android.arch.persistence.room.InvalidationTracker.Observer;
import android.arch.persistence.room.RoomDatabase;
import android.arch.persistence.room.RoomSQLiteQuery;
import android.arch.persistence.room.util.StringUtil;
I've tried deleting the build folder so that the file could be regenerated, but no luck.
This was fixed by adding the following implementation to the dependencies under build.gradle (Module: app)
implementation 'android.arch.lifecycle:livedata:1.1.1'
I have a file in Java that was given to me that I am trying to edit, however when I hit build in netbeans, I get the errors below. It worked fine until I made the changes. I'm not sure why the jar file would work before, and yet now I can't build it. I'm a noob... How do I get these packages? Thanks.
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:15: error: package org.jsoup does not exist
import org.jsoup.Jsoup;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:16: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Document;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:17: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Element;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:18: error: package org.jsoup.select does not exist
import org.jsoup.select.Elements;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:19: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:20: error: package org.openqa.selenium does not exist
import org.openqa.selenium.Keys;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:21: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:22: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:23: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:24: error: package org.openqa.selenium.interactions does not exist
import org.openqa.selenium.interactions.Actions;
It looks like path for the jsoup.jar and selenium.jar is not located correctly.
First download jsoup.jar from here and selenium.jar from here and add them to libraries of your project.
in netbeans in project window Expand your project and right click on libraries ans select add jar/folder and locate your jsoup.jar and selenium.jar file locations and Add them. Then build the project.
You are supposed to include the third party dependency jars in your project.
https://jsoup.org/download
http://docs.seleniumhq.org/download/
You can download them from here.
Edit your project properties, go to library and add these jars. Should do it.
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?
I've seen questions with Eclipse Javadoc so far this, this and this but these are specific to Eclipse. But I want it for ANDROID STUDIO. My project has submodules and customview. Below is the error:
BootStarp1\Base-App\src\main\java\com\rspllib\android\utils\FileUpload\CustomMultiPartEntity.java:3: error: package android.util does not exist
import android.util.Log;
^
D:\MonkeyTalk\MonkeyStudioWorkspace\BootStarp1\Base-App\src\main\java\com\rspllib\android\utils\FileUpload\CustomMultiPartEntity.java:18: error: cannot access HttpEntity
public class CustomMultiPartEntity extends MultipartEntity
^
class file for org.apache.http.HttpEntity not found
D:\MonkeyTalk\MonkeyStudioWorkspace\BootStarp1\Base- App\src\main\java\com\rspllib\android\utils\FileUpload\FileUploading.java:3: error: package android.util does not exist
import android.util.Log;
^
After reading here I could finally apply the workaround. Make sure you give the path till your android-jar in the "Other command line arguments" field viz:
-bootclasspath D:\android-studio-.3.2\sdk\platforms\android-19\android.jar
do not forget to add "-bootclasspath".
import com.example.TestParser;
The TestParser.rl file is where it should be but still I get an compile error. Is there anyway how to import .rl files?