Cannot resolve symbol problem - Android Studio

Hi everyone
I'm having this issue where I'm getting an error that states, "cannot resolve symbol". These words below are red:
HttpEntity
HttpResponse
ClientProtocolException
HttpPost
DefaultHttpClient
I've tried, with no luck:
1. Build > Clean Project
2. Build > Rebuild Project
3. File > Invalidate Caches/Restart > Invalidate and Restart
My mainActivity.java class is fine but my JSONParser.java class is throwing me these errors, why so? This happened out of no where :crying:
Thanks for reading :laugh:
Code:
package com.apress.gerber.currencies;
import android.util.Log;
import org.apache.http.HttpEntity; // red
import org.apache.http.HttpResponse; // red
import org.apache.http.client.ClientProtocolException; // red
import org.apache.http.client.methods.HttpPost; // red
import org.apache.http.impl.client.DefaultHttpClient; // red
import org.json.JSONException;
public class JSONParser {
}

I had this this issue too. A simple 'gradlew clean' and 'gradlew build' did the trick.
Click on Build->Clean Project and that will perform a gradle clean

BUMP
this has 1year old now but this was the only topic i found aboud this
Cannot find symbol method. findViewById and setText
im on the basics yet, in my last exercice i used it and worked fine, looked on internet and tried almos anything and the problems keep there.
the solutions above didnt work.
Edit:Resolved. thanks

Related

[Q] How to use XposedBridgeApi to modify the mobile phone resolution

How to use XposedBridgeApi to modify the mobile phone resolution
Check App Setting's source code.
I use XposedHelpers.findAndHookMethod (XposedHelpers.findClass ("android.util.DisplayMetrics", "widthPixels", lpparam.classLoader), new XC_MethodHook () {}); error: unable to find "widthPixels" method, view the android.util.DisplayMetrics.class source code, found that "widthPixels" is a field, now that the problem is in the XposedHelpers class, I do not know what methods to achieve.
I use XposedHelpers.findAndHookMethod (XposedHelpers.findClass ("android.util.DisplayMetrics", "widthPixels", lpparam.classLoader), new XC_MethodHook () {}); error: unable to find "widthPixels" method, view the android.util.DisplayMetrics.class source code, found that "widthPixels" is a field, now that the problem is in the XposedHelpers class, I do not know what methods to achieve.

[Q] [HELP] sqlite and BackgroundTask

Hi,
I'm trying to implement a backgroundTask in an Universal Windows App (Windows phone runtime 8.1) and I need to do a consult in the database of the App in order to connect to my webservice on the cloud. The foreground of App uses sqlite-net nuget package without problems. But when I add it on the Windows runtime class (backgroungTask) generate 24 errors on the class Sqlite.cs. I have searched more information About this, and I have found other package that is better (because It is compatible with xamarin) that is called: sqlite.Net PCL 3.0.5 So I have installed it in my backgroundTask Project and I get an error that is the following:
Code:
Error 6 Windows Runtime type 'Windows.Foundation.Point' was found in multiple referenced winmd files. Please remove either 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\References\CommonConfiguration\neutral\platform.winmd' or 'C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\Windows.winmd' from the list of referenced files.
I don't know what I can do with this error. Could you help me to use sqlite in my background task?
Thank you!!
Hi again,
I have got to solve the error that I have comment because the sqlite.net pcl doesn't need vclibs12 so I delete this and then I get 24 errors. All are of one kind error, DateTime. It returns the next message:
Code:
Error 9 Method 'Tarea.UnixToDateTime(System.Int64)' returns 'System.DateTime', which is not a valid Windows Runtime type. Methods exposed to Windows Runtime must return only Windows Runtime types.
Then, the information that I have on this format, how could I get them? Or Have I change all code and the database with other type?
Thank you again!
A DateTime is just a 64-bit number underneath, with a little metadata about time zones and such. You should be able to either create a C++/CX struct for it, or just pass the int64_t and re-build the datetime on the other side.
GoodDayToDie said:
A DateTime is just a 64-bit number underneath, with a little metadata about time zones and such. You should be able to either create a C++/CX struct for it, or just pass the int64_t and re-build the datetime on the other side.
Click to expand...
Click to collapse
Hi goodDaytoDie!
Thank you by your ideas, I have changed the type of data of the Database to int64 and I have calculated the date with DateTimeOffset (this works on backgroundTask). In addition, I didn't know this type of data, but I like it because it allows get the date on different time zones without making nothing.
Thanks!!:good:

In AS Ver 2.1.2 , Adding Facebook SDK in build.gradle syncworks,but app launch failed

Hi folks,
After adding this dependencie in build.gradle sync works, while launch application - In mainactivity.java used fragmentPagerAdapter subclass is declared but still its getting,
here its java.lang.ClassNotFoundException (i.e com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run) while debugging.
error exactly that this line:
mainActivityFragmentPageAdapter = new MainActivityFragmentPageAdapter(getSupportFragmentManager());
Thanks In Advance,
All

Error compiling CM13 - ThemesContract.ThemeMixColum ns cannot be resolved

Hi guys, i am tryning to compile CM13 for oneplus3 and after almost 170 minutes the build process fails with:
Code:
/data/home/build/android/system/packages/providers/ThemesProvider/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java:35: The import cyanogenmod.providers.ThemesContract.ThemeMixColum ns cannot be resolved
ERROR: /data/home/build/android/system/packages/providers/ThemesProvider/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java:36: The import cyanogenmod.providers.ThemesContract.ThemeMixEntry Columns cannot be resolved
ERROR: /data/home/build/android/system/packages/providers/ThemesProvider/src/org/cyanogenmod/themes/provider/ThemesOpenHelper.java:672: ThemeMixColumns cannot be resolved to a variable
Any ideas ? I have already repo sync several times to see if it would fix but it has not.
https://github.com/CyanogenMod/cm_platform_sdk/commit/c4f27d5b812df3d66c21b4d7ba1d1d216cc0c593 this solved error for me (crDroid 6.0.0)

Android Studio 3.1.3: Error message 'Cannot find symbol: View'

I'm new to Android development and I just started playing with Android Studio 3.1.3. I'm following a tutorial from android.developer.com and I'm on the part: Start Another Activity - Respond to the Send button. Thing is, when I add the sendMessage() method stub, I get an error message saying the symbol View cannot be found. I tried the following steps to resolve the issue but I'm not successful:
- Place the cursor on View then click ALT-ENTER but the menu Import class doesn't appear.
- I clicked File - Invalidate Caches/Restart
Any useful assistance is welcome.
Christopher

Categories

Resources