Android Studio Gradle and Rendering Issue - android

This is the first time I am using Android Studio to create an android application.
When I load my "activity_main.xml" file for editing purpose it shows me the following error.
Please find below screenshots.
Please Suggest fixes if any.

Try to click on Tools>Android>AVD Manager. Click New and select a device with a Target API higher than your Project API. After that restart Android Studio and load your Project. Then try again.

You need to run the AVD Manager to add a virtual device that matches the target API version your project is set to. Click Tools->Android->AVD Manager. Click on 'New', add virtual devices targeting higher API levels, e.g 18, 19, etc. Then restart Android Studio, and open your project, it should find a target device to allow you access to the Design view.
After this you sync your gradil this will solve your issue. For more Check for more information

Related

Error in all android projects

I have been using eclips for android programming since about 6 months. Everything was working smooth till yesterday.
On restarting Eclipse it shows error on every project and all of them say:
Unable to resolve target 'android-21'.
And I can't even create any new project as it always says
Base Theme "Holo Light with Dark Action Bar" requires a build target API version of at least 14, and the current version is 8
And I cant start SDK manager from eclipse. Please help, and thank you everyone in advance. :)
Go to Windows -> Android SDK Manager Install the Android API Level you want, in this case 21.
Once you've finished installing, go to Window -> Preference -> Android. You should get a list of available targets. Click Apply then Ok.
Now right click your project, go to properties. Click Android. Choose your desired target.

Rendering Problems Android Studio 0.8.2

I updated Android Studio to 0.8.2 and at first I had Gradle problems and Rendering Problems.
My Rendering Problem was that I didn't select a render target. After fixing this problem I got another Rendering problem.
Rendering Problems File C:\Users\User\AppData\Local\Android\android-studio2\sdk\platforms\android-19\data\layoutlib.jar doesnt exist (Details).
I've searched so much on the internet and I even downloaded the layoutlib.jar file but it didn't solve my problem. I really need help because I wanna concentrate on my work.
THANK YOU IN ADVANCE
Had the same problem. What worked for me is deleting the SDK Platform for the specific API (19 in this case) using Android SDK manager. If you open SDK manager and expand the different Platforms packages like Android 5.0.1(API 21) and so on, you'll see the respective SDK Platform underneath. Select the one you're having trouble with and delete it. Then reinstall it.
Try to update SDK.
Tools -> Android -> SDK Manager, when the manager is opened packages which have updates will be checked, you just click "Install packages".
Delete all items in andoid 21 and install again. Your problem will be solved. Thanks..
Just uninstall and reinstall
specific android APK
with android here it android-19
Tools -> Android -> SDK Manager
1.uncheck the specific android APK android check box the apply (wait if need to unistall)
recheck the same specific android APK android apk and then click on Apply

I am geting an error while building android project?

gen folder is missing is the issue.The build patch failed .I have tried all solutions posted previously on this and no luck.
EDIT
To make it clear here is my original post
https://salesforce.stackexchange.com/questions/9460/encountering-issues-while-developing-android-hybrid-mobile-app
I am using salesforce SDK but when i am creating hello world app using native its working fine
Even if you delete the gen folder, it'll regenerate it after you compile your program.But if it is not then try creating a new project and try it again .If not , try a fresh installation of the API.
Update
Hmm, everyone in both posts is telling you to download the "SDK Platform" for "Android 2.2 (API 8)". I really, really recommend trying this. It is apparently required by the library you added to your project...
I have 4.2 and 4.1 .Is that not enough?
No, you must have the older platforms that you are building against.
Simply download it and open Project > Properties, click on Android, then select Android 2.2. After all this clean your project and save it.
Original Answer
The screenshot doesn't give us much detail, but:
Unable to Resolve target 'android-8'
Tells me that you probably don't have the SDK Platform for API 8, simply download this through the SDK Manager. Or you can change any references in your manifest and the rest of your code to use an API that you already have.
I think it is because when
you import a project, build
target is not set in the
project properties which
then default to the value
used in manifest file. and make sure you have API 8.
The solution is to enable
build target toward your
installed API level (but keep
the minimum api support as
specified in the manifest
file).

how to add the new api level in android?

I am using Android API level-8(i.e. Android 2.2 Froyo). I want to add the new api level-5 ( i.e. Android 2.0 Eclair).
I have updated avd manager but the api level-5 can't display.
When I import the project in workspace the right click the project select android tools and fix the Project properties then Display this type error in console
Unable to resolve target 'android-5'
You should clarify what you mean by add.
If you mean add another OS image, then you should use the Android SDK Manager.
In the package name you should find the Android 2.0. If you didn't have it installed, then install it and create a new OS Emulator with this OS version.
There's a topic already discussed here. Link
If you mean you want to build against Android 2.0, you should simply right click on the project, go to properties, and then Android. You should see a list of targets. Simply check the one right for you.
Go to sdk manager and install required lvl from it
Goto window->android sdk manager and check the boxes you want to install. One of the checkboxes also concerns the avd, install it and then goto window->avd manager to create a new AVD.

How to install older Android SDK in Eclipse

I'm working at the moment at a simple app in eclipse for android. Just receiving and sending data, and using the camera API.
I've set the minSDKversion to 8, because I think that has the widest user base. But at the beginning of the project eclipse was asking me which target SDK version I would use, and because I had just one installed (the latest 4.0.3) I've took this.
Now I'm asking me if it wouldn't be wiser to install a lower SDK, like Android 2.2, because it would be not that big (compared to the 4.0.3) and my app would not have included all the fancy new features, which are not used in any way?! Or is this complete nonsense I'm talking here, and just should take my 4.0.3 SDK? When not, how can I install a lower version? Help -> SDK Manager is not showing old SDKs...
Here is a very helpful link that will probably answer your question: http://developer.android.com/sdk/installing/adding-packages.html
Basically, open up the Android SDK manager and it should give you a list of packages that you can install! From there you can choose old SDKs!
hey i faced the same issue as yours
usually while updating due to this error , it is unable to fetch the older SDKs
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list.xml, reason: File not found
This is how you can fix it :
1) Go to Window > AndroidSDK Manager
2) select tools> options
3) set the proxy (if u r sitting behind proxy)
4) in checkboxes check Obsolete option (in Android SDK Manager)
5) go to Packages > reload (in Android SDK Manager)
This worked for me
In case you are using windows7 .
Go to Android SDK Manager location > right click > Run as Administrator
Best Regards,
Ashwani kumar
I was having a problem with this also. I tried all of the things listed in the other answers here and nothing worked. I went into Tools/Options (in the Android SDK Manager) and checked "Force https:// sources to be fetched using http://" and reloaded and the older APIs magically appeared.
if u want minSDKversion from its maxSDKversion
1.select maxSDKversion and delete all old pakages .
2. after doing it sdk manager will show all its older versions .
3. select required version and install all packages again.
:) :)
it worked for me .. just try .

Categories

Resources