Android SDK beginner question - android

I'm a n00b developer at my second attempt to use the Android SDK. I'm
developing on the Mac platform and I've noticed that the latest
version of the SDK doesn't include anything except the tools (so I
have no plugins, no targets to choose from inside the package I
downloaded).
So I tried to use the Android SDK and AVD Manager to download and
install some, however, I got this error:
Failed to fetch URL https://dl-ssl.google.com/android/repository/
I went to the settings and checked the box to force fetching via HTTP,
but no result. I was suggested to look for a configuration file, but
couldn't find any.
Any suggestions? I'm dying to get my hands dirty with the SDK.

Whenever I've seen that error, I've just retried the download several times and eventually it went through. I've only run into it when I was behind a proxy, but that might not be your problem.

Here you have a Android tutorial, step by step.
http://www.vogella.de/articles/Android/article.html

Its means that you are behind a proxy.Go tools->options in your android SDK manager and enter your http Proxy server and port and it'll work.

Related

Android studio isn't opening [duplicate]

Every time I run Android Studio, this loading screen pops up, but Android Studio stays here and doesn't load. It's like this following picture except that the loading bar is loaded all the way but stuck there. I am running Windows 10.
I have tried many things, including setting the system variables JDK_HOME to where my JDK is located and the same for JAVA_HOME. I have also set a path. I ran as admin many times and let AS through a firewall.
I have also restarted and reinstalled countless times.
The version of AS is 2.0, and I am running the latest versions of Java.
Any help?
Open file Android Studio setup directory/bin/idea.properties
Add disable.android.first.run=true to end
Restart Android Studio
PLEASE NOTE: This will break patch updating to the next version. We
now check full binary checksums on the whole installation to prevent
various install corruption bugs as well as to preserve application
signatures. Therefore, make a copy of this file first, and before
updating, put it back.
Please try the following method to fix that issue:
Find the folder of your AndroidStudio: based on the following directory
macOS: ~/Library/Application Support/Google/AndroidStudio[version]
Delete the AndroidStudio folder.
Restart
Ref:https://developer.android.com/studio/known-issues#studio-config-directories
In order to know how to debug the problem, I executed the bin\studio.bat script in the terminal and inspected the actual Idea exceptions in order to fix the problem.
For me, this was the issue:
ERROR - llij.ide.plugins.PluginManager - java.net.BindException: Address already in use: bind
java.util.concurrent.CompletionException: java.net.BindException: Address already in use: bind
This means the plugin manager is trying to listen on a port that is not available. Is something listening on that port? For me, it was the stupid "excluded ports" by Windows, so I simply stopped the service:
net stop winnat (as administrator), and confirmed that Android Studio started to work.
No need to re-install, delete precious configuration (and plugins, etc.). Just read the log provided by the bin\studio.bat script, and I was able to fix the issue.

All packages are not available for download error in android

All packages are not available for download!
The following packages are not available:
- Package id sources;android-24
Am trying getting data from database by using of web services, when am running the application getting an above shown error.
How can I resolve this issue in the android studio?
Open SDK Manager -> SDK Platform
Check on Show Package Details and Sources for Android ... then download
The popup error is not related to the exception you got on your application. Api 24 source code is not fully available. Hence you got the error. Change complieSdkVersion and targetSdkVersion to 23 and sync the gradle.
I just closed my IDE then restarted my computer. When I opened the IDE the error was no more.
Make sure you have good internet connection, as the error might be caused by a lack of internet connection preventing the IDE from reaching the site.
Check if the SDK version is installed on Android studio for that particular Android device. e.g. If Android Device has version 4.3 then check if SDK for this version 4.3 is installed, you can check it through Android Studio SDK manager. If not installed then install it complete.
Restart Android studio, reconnect the device, That's it
A thing I ran into, check to see if you have more than one android sdk on your box. I'm not sure if it was confusing Android studio or not, but I had one previously installed under Program Files. I ended up going into the AppData\Local\Android version used by Android studio and adding stuff I needed manually running the SDK manager as administrator.
This means that you can't reach the download site, and it has many reasons one of them is that you are in a country in wich the American laws won't allow to use such technology so you have to use a proxy program and to configure the sitting in your Android studio to use the proxy gate and port.

Run Google Play Services 5.0.89 on emulator

I'm trying to run an application using the latest Google Play Services (5.0.89 at the moment) on the android emulator, but every time I open it, I get the notification asking me to update G.P.S. I'm using a "Google API L18" AVD. And this is quite annoying if you're trying to run some espresso tests.
Apparently, it's a common problem that keeps plaguing android developers: https://code.google.com/p/android/issues/detail?id=57880
So far I've tried:
just clicking ok -> but then I'm not connected to the services, which is bad
switching to the Android L Preview AVD -> same problem
downloading the G.P.S. apk from somewhere and trying to install it. Fails, since it's already present (and cannot be uninstalled)
creating and AVD without G.P.S. and installing them manually. I get a "device not supported" error
installing just a few packages (like this "adb -e install com.google.android.gms.apk) -> but I cannot find them for the 5.0.89 version
in my application code, ignore the error returned by GooglePlayServicesUtil.isGooglePlayServicesAvailable -> the connection still fails (which means that simply not checking is not an option)
UPDATE Trying to edit the value of GooglePlayServicesUtil.GOOGLE_PLAY_SERVICES_VERSION_CODE through reflection -> didnt't work (btw, yes I know it's an horrible hack, at this point it was more curiosity than anything else)
So, did anyone find a solution for this?
So far, the only option I can come up with to make it work is to delete my local copy of G.P.S. from the SDK tools, replace it with a previous version downloaded from somewhere (I haven't looked for it yet, but I'm pretty sure I'll be able to find some shady site providing it) and then rebuild my app. But this isn't something I'd like to do.
If you go to the SDK Manager and check for updates, there should be an update for the API 19 system images. Have you tried updating to those and recreating the emulator and seeing if the problem persists?

Android Device Window Chooser not working after updating device

I've always used my android phone for development but after installing the last software update on my device (4.2.2) it suddenly stopped working and would appear offline in eclipse's Device Window Chooser.
I'm not able to send applications to it for testing or access it with the adb-shell. I have developer options turned on and debugging mode enabled. I'm using Eclipse Helios on Ubuntu linux.
When I launch Eclipse the following window will show up
and after clicking on the check for updates I get the following error:
Unable to read repository at jar:file:/home/matteo/Downloads/ADT-18.0.0.zip!/site.xml.
error in opening zip file</code>.
Last thing, if I open Window->Preferences and go on Android I see this:
This question is not a duplicate of Android device chooser - My device seems offline (of which I read every single line). It's a request for some rigorous solution from the community. In fact non of the proposed solutions helped me in getting my device to appear online, as you can see in the attached snapshot.
Please help me! Any suggestion will be very appreciated! ;D
Ok open sdk manager /sdk/tools/android now download the sdk for your new android version. In my case it was API 17. Once its done you should be ready.
If you still got some issue be sure that you have the last version of the ADT installed. Installing it again http://developer.android.com/sdk/installing/installing-adt.html
Now you should be ready to go.

Android SDK installation failed - Connection reset. Nothing is installed

Hello I have a problem with installing the packages using the Android SDK Manager.
I get Connection reset. Nothing is installed.
I am on Windows 7 64 bits using JDK 7.
Here is what I tried so far without success:
Installed Android SDK installer_r18-windows.exe
Then run Android SDK Manager as Administrator and I can select which packages I want to install.
So far so good.
Then when I select the packages I want and click Install then the log says:
Downloading SDK Platform Android 2.3.3, API 10, revision 2
peer not authenticated
I googled this error and they say that you need to set Force https://... sources to be fetched using http://....
If I do that and click install I get this error:
Downloading SDK Platform Android 2.3.3, API 10, revision 2
Connection reset
At every package it tries to install.
I tried setting the proxy setting according to my internet providers setting. I get the errors again.
I tried deactivating the firewall. Same errors.
So how do I get the Andoid SDK Manager to install the packages succesfully?.
Thank you for your help.
Others have also faced similar problems when downloadind SDK components.
A simple way to fix this problem is to modify the Pkg.SourceUrl property, changing HTTPS to HTTP to avoid secure downloads, as illustrated in the answer to this question.
I ran into the same problem today. In my case, the download would start and then abort with the same error message.
If the download starts and then aborts, try downloading again - SDK Manager will resume the download where it aborted. It doesn't advertise that feature (let alone resume by itself), but the log entries report that it is in fact resuming the download.
You might need to retry a few times - depending on how stable your Internet connection is and how much you download. Not too elegant, but will do for a quick on-the-fly install.
This may be cause of system time may have changed. Synchronize your system time with one of the internet time servers. Restart the installation. Hope it works.

Categories

Resources