Android SDK issues? - java

I imported my project recently. I face the issue that is sometime It can not reference Android Java class.
and more ..
But when I open the Android SDK code. The missing class is available. Does anyone know why it says "Cannot resolve symbol"
I also tried to invalidate Android Studio Caches and Restart but it still has the issues.
Gradle build errors:

Check which android sdk you are compiling for compatibility with. Though you may be targetting 21, if you are requesting compatibility with an older version it will not let you use new classes. If that is the case, up the minSdkVersion setting in your gradle file, such as to
minSdkVersion 21

Related

Unity Ads 2.0 Eclipse Library

I am trying to get UnityAds 2.0 Library in one of my eclipse Project. I have imported Project from here https://github.com/Unity-Technologies/unity-ads-android. I have solved other errors in project but I am still getting two errors in my project called below.
VERSION_CODE cannot be resolved or is not a field
and
The import android.webkit.WebResourceError cannot be resolved
My Target SDK is Google API 22
Let me know what I am missing.
Thanks
You need to be on target SDK version 23 or better.
https://github.com/Unity-Technologies/unity-ads-android/blob/master/lib/build.gradle#L14

android-support-v7-appcompat error on eclipse [duplicate]

After upgrading to Android Studio 1.3.1 yesterday, Getting this error when building projects, I cannot create a new project. Adding error and build.gradle file below :
Alredy tried changing compileSdkVersion and buildToolVersion to 21.
Every major revision of the Support Library, such as the 23.0.0 AppCompat you are using, compiles against the API level of the same number: i.e., API 23 as per this G+ post from the AppCompat developer. Therefore to use 23.0.0, you must update your compileSdkVersion to 23.
Note this is completely different from targeting API 23 (which can be done separately and is what is required to use the runtime permissions model).

Eclipse and ADT Error

I installed Eclipse and ADT plugin 23.0.4, but sometimes when I click XML in my project,this problem may happens:
An internal error occurred during: "Check Android SDK".
java.util.ConcurrentModificationException
I don't know why and I have already tried to delete the SDK files and download them again.
How do I fix this?
This problem has already been discussed in detail here.
You may have a problem with you Android SDK version. Check in you manifest and compare it to the SDKs you have installed. Start your Android SDK Manager and make sure you also have the tools installed, it is described in more detail here.
If none of that helps, you could always switch to Android Studio, which is now the "official Android IDE." Since I switched I have encounter fewer problems.

Struggling to compile android apps in Eclipse with a min-sdk that is smaller than the target-sdk

I'm struggling with "no resource found" issues whenever I set my min sdk levels to be smaller than the target+compile sdk levels. I've tried a lot of support library solutions to this problem but none of them have worked.
Here is one error in the eclipse console out of hundreds of these:
SourceCode\AndroidExact\appcompat_v7\res\values-v21\themes_base.xml:191:
error: Error: No resource found that matches the given name: attr
'android:colorPrimaryDark'
However, I can compile and run my android apps in two cases:
minSDK = targetSDK.
minSDK = (any api level) and targetSDK = (api level 21).
For these two cases, I am able to use the Eclipse GUI wizard to create and run an empty hello world android application project. I can also write a more complex app for these two cases.
But for cases where (minSDK < targetSDK and targetSDK != 21), my Android apps will not compile due to the "no resource error".
This solution[1] by reVerse on stackoverflow works. But there is a catch. It only works for target 21. I tried target 19, and it doesn't work. I need to be able to choose a target other than 21, for learning purposes and for device-specific apps.
I have also tried the following (and failed):
Installing JDK 7, and configuring for android workspace
Installing JDK 6, and configuring for android workspace
I think I will be able to make it work if I use JDK 7 with Eclipse Kepler, and that I am configuring my Eclipse wrong.
From Froyo to Lollipop I have the SDK Platform and Google API installed. I also installed the Android Support Repo, Android Support Library, Google Play Services, Google Play Repository, Google USB Driver, and the HAXM driver. I have uninstalled and reinstalled these packages just in case they may have been unintentionally deleted outside the sdk manager.
I am using Windows 7, Eclipse Luna, JDK 8, and ADT 23.0.4.
Do you guys have any suggestions or solutions? I will provide more specific details upon request, as I will do whatever it takes to make this work on Eclipse.
Jump on the Android Studio wagon. It's now at version 1. My advice is to create a new project in Android Studio then slowly one by one manually copy in your source files. This will give you a lot of experience with the new ide and you won't have a single headache with the migration wizardry. Besides that with android studio and gradle to use the support (v7) libraries requires one line in the gradle file.
Example this is all you need in the gradle file with android studio for a google map application and the support libraries where its two extra projects in eclipse.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21+'
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile "com.android.support:support-v4:21+"
}

Android .R not generating - checked all common causes

After getting a new computer and setting up eclipse again, no projects are generating the .R file. The SDK is on revision 22 which I noticed some people had issues with, but setting the Private Libraries checkbox did not resolve this.
The .R isn't generating for existing projects nor brand new empty android projects. The SDK levels between the build configurations and the manifest match.
An entire uninstall of the SDK, and redownloading the Android version of eclipse and SDK didn't work as well. Could it be something with the versions of Java installed on the machine? Or is there some other common cause of the R not generating I missed after searching?
I got the same error as yours.
note:
The SDK directory architecture of 22.0.1 version is different from before.
there is not platform-tools directory and some command file move to other directory.
but,eclipse and ADT plugin does not update according with SDK
so, linking related bin to platform-tools directory will work.
above meet my error.
Update your SDK Tools from the SDK manager and ADT in eclipse, this was fixed in the latest update (22.0.1)
Also, after you update your SDK, close and reopen the SDK and check for updates again (in case you don't see 22.0.1)
Take a look here for some similar issues Class not found error after updating ADT and Android sdk tools to latest ver 22

Categories