Eclipse Android No resource error - android

I have started learning android development using the eclipse IDE. I am using the book "Android application programming" by James Talbot & Justin McLean.
I have downloaded Eclipse and the Android SDK. However, when I create a new android project I get the error:
[2018-04-16 23:53:15 - OnYourBike-Chapter3] C:\Users\benjo\workspace\learningandroid\OnYourBike-Chapter3\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2018-04-16 23:53:15 - OnYourBike-Chapter3]
and another one but for Theme.AppCompat.Light.
I am very new to both eclipse and android SDK and the solutions I have read were mostly to go to "android-sdk\extras\android\support\v4 or v7 and import a library. I don't have these v4 or v7 folders. I have a bunch of folders like this:
Folder contents
I have tried adding the .jar libraries from these folders, but it didn't work.
I have tried cleaning, building the project, replacing the code in the style.xml file, installing the Android Support Repository (tried installing Android Support Library, but couldn't find it).
I have gone through atleast 10 threads just on stackoverflow and couldn't fix my issue. Nothing worked.
My mainActivity.java file is full of errors, and looks like this:
mainActivity
The error on the import reads: "The import android.support cannot be resolved".
Here are pictures of my Android SDK Manager :
Android SDK Manager SDK Tools
Android SDK Manager Extras
Hopefully someone can help me solve this. It is really frustrating and I have spent my whole day trying to fix this with no success.

Related

Is Android Support Reposity includeable in Eclipse Neon?

for certain compatibility reasons, I have to use Eclipse Neon for Android Development to develop an android app. Therefore I also have to use the newest Android SDK so I can implement some newest features.
Now, I am facing the problem that I cannot compile any Android app with Eclipse, because I get errors like
The import android.support cannot be resolved
ActionBarActivity cannot be resolved to a type
Error retrieving parent for item: No resource found that matches the given name "ThemeAppCompat. …"
upon building. As I found out, this is because Eclipse is missing the "Android support library" (android support library.jar ?) in the sdk folder. The reason for this is, as I found out, that this library is obsolete and has been replaced by the "Android support repository". It has not been installed by the Android SDK manager and cannot be installed anymore, but Eclipse still needs it apparently.
I searched a lot for a solution for this but all answers I could find was "Swtich to Android Studio"… Unfortunately, there is no way around using Eclipse for me. Is there any known way to include the support repository and make eclipse use it? I found this site
https://developer.android.com/topic/libraries/support-library/setup.html
and thought, maybe I can follow these steps to make my app to a gradle.build and then include the stuff from the repository and get my stuff to work, but unfortunately I could not find a way to realize this.
I changed the related section in the gradle.build file to this:
…
dependencies {
…
compile 'com.android.support:appcompat-v7:24.0.0'
}
…
but could not get the app being built.
Is there any known solution for this? I actually cannot imagine that I am the only one trying to develop an Android App with the new support repository file these days. Should I maybe manually insert the obsolete (but newest) android support library.jar file from an older IDE? Could this work?
Thank you many times for your help.

Extreme case of "Error retrieving parent for item"

My Xamarin Android project doesn't compile anymore, with a couple error messages saying
Error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Widget.Design.TabLayout'
Other errors that were thrown previously were in the same style, but said
No resource found that matches the given name (at 'textColor' with value '#color/md_white_1000')
I am aware that this is a very common Xamarin bug that is normally fixed by cleaning and rebuilding or, in rare cases, by clearing all packages and package caches so that they are downloaded again. However, this did not fix my error. I also completely reinstalled Xamarin and Visual Studio, but the error persists. At this point, i don't really know what to do except completely reformat my Mac.
Are there any trouble shooting steps I missed? Is this a bug that is only present in some version so that I need to downgrade? Please help, as I haven't been able to compile my code now for two days.
The log is saying that the app could not find certain resources, like TabLayout and #color/md_white_1000.
Did you install the NuGet packages related to Android AppCompat libraries? In NuGet Package Manager, search for AppCompat libraries. For example:
https://www.nuget.org/packages/Xamarin.Android.Support.v7.AppCompat
Those are necessary to find AppCompat resources and themes.
I found the answer: Apparently the newest version of the Xamarin AppCompat Package is corrupt. I was able to compile again by manually copying the project from my colleague, who hadn't updated his packages (the packages are in our .gitignore). That solved the problem and also explains why clearing the package caches didn't work: Visual Studio simply re-downloaded the corrupt package.

Compiling and using AppCompatActivity in Eclipse

I have the latest Android Support Library, Android Support Repository and Google Repository (Rev. 23.1, 24, 22 respectively) and working with Eclipse Mars.1(4.5.1)
In the process of giving a make-over to an existing app, I am trying to import the v7.AppCompatActivity library, closing all other projects in workspace and silent prayers. ( ;-) )
Observations:
I daresay I have been unsuccessful even after following the instructions here to the dot.
Ian Lake's blog looks all hunky-dory, but Utopian.
Reading up tons of excellent answers on SO did not yet help. No matter what target is set in the project.properties page or what Build Target is set in the Eclipse Project Properties dialog - just cannot seem to get rid of this (and very similar) compile error(s):
android-support-v7-appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Going by the number of similar questions, I am surely not alone. Pray, can someone kindly throw some light on how to import the v7 support library without going insane?
Thanks in advance!
None of the answers or blogs pointed out the following, except #pkuszewski.
The above issue resolves on
upgrading to Android 6 Marshmallow API 6.0 with the SDK manager
setting the Build Target for the AppCompat project to Android 6.0
Did I hear, "Duh"? :)
Thanks, #pkuszewski!
SDK Manager fragment looks like this, post the fix:

How to add Crosswalk project to Android studio?

I am trying out android crosswalk project. I am having problems adding crosswalk webview to andriod studio though. I am not sure where I am going wrong nor do I understand most terminology yet.
I read https://crosswalk-project.org/documentation/embedding_crosswalk.html but I refers to https://developer.android.com/tools/sdk/eclipse-adt.html which is no longer supported. This seems to be outdated but I tried anyway with Android Studio 1.2.2.
I tried making a project with https://crosswalk-project.org/documentation/downloads.html Android webview (ARM) 13.42.319.11 as told in the documention. I am not sure what is meant with 'open ADT' but I assumed Android Studio instead of the plugin of eclipse. I opened from an 'existing android studio project' (the download unzipped). But didn't come across the option 'set root directory'.
I then tried to create a new android studio project and ran it. It showed the basic hello wold example on my phone. Then I followed the remaining steps by pasting in the code they provided. I ran it again and got 3 errors:
Error:(3, 22) error: package org.xwalk.core does not exist
Error:(9, 13) error: cannot find symbol class XWalkView
Error:(15, 23) error: cannot find symbol class XWalkView
I am not sure what to do from here as this is all very new to me.
Basically I am trying to run there example but can't figure out why the import isn't working.
I am having the same problem but I finally fixed it by placing the xwalk_core_library.jar in the libs folder, together with arm64-v8a and x86_64 subfolders and I have removed compile 'org.xwalk:xwalk_core_library:x.x.x.x' from dependecies.
Updated Links 19-07-2016
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
And In dependencies add this
compile 'org.xwalk:xwalk_core_library_beta:9.38.208.8'

importing R. (android)

I have searched through Stack Overflow as I know this is a common question, but none of the solutions seemed to work for me. This included cleaning my project, deleting all imports and deleting the project and starting again entirely.
I am using the Eclipse specifically for android on mac (ADT bundle mac).
Whenever I create a new project I have errors immediatley in my src folder on the line
setContentView(R.layout.activity_main);
and also on inflate.
Any suggestions other than those stated? It is literally before I have done any programming so cannot understand what is wrong.
EDIT: Fixed. Downloaded the SDK a second time and this seems to have fixed it.
import The R class. The basic syntax is
import your_application_package_name.R;
If you have already imported it but it is not working then check if there in any error in your resource xmls. If so then r can be not generated and that error will be shown
Change your Project Build Target to the Latest
Right Click Project > Properties > Android > Change the Api to latest version
Try to update the Android_SDK. When you create or import a new Android project the SDk builds the project. The R problem is mostly an update SDK problem.

Categories

Resources