How to create a project in Android Studio - android

I installed the android studio successfully but any time I want to launch an new project (after naming the activity),I get an error message saying "can't resolve host at service.gradle.com" How do I resolve this?

This sounds like a firewall of some sort is blocking Android Studio's connection to gradle. Check to make sure any antiviruses you have installed have Android Studio allowed through their firewall.

Related

Gradle Project Sync Failed on Android Studio

I am new to Android App development.I installed Java Development Kit andAndroid Studio v 3.0.1 . There was no problem in downloading and installing Android Studio. The problem came when the time came to creat a new project. My instructor on the course told me the new project would take time to set up and configure. Mine took some 115 minutes. And after it came a Windows Alert Message mentioning that Windows Firewall has blocked some features of JDK library.
This is the screen shot of the Windows Alert Message.
Windows Alert Message
I just ignored the message, and clicked the Close button.
And when I see my newly opened project on Android Studio, I see the message that
Gradle Project sync failed.Basic functionlity will not work properly.
This is the screenshot of Gradle Error.
Gradle Project Sync Failed
I am clueless about what this Gradle is. Does this gradle error have anything to do to do with the Windows Alert Message I ignored? How can I fix this problem?
I want to create apps and just new to Android App development.
Windows Firewall automatically blocked Internet access for Android Studio and informed you about that in that dialog. Most programs, like Android Studio need Internet access, so in the future you want to click "Allow access" button whenever that dialog show up (for trusted software).
Go to Windows Firewall and in the "Allow a program or feature through Windows Firewall" option look for "OpenJDK Platform binary" and check both checkboxes.
Screenshot tutorial, but for Firefox

Android Studio: more info about "Error installing app"

When trying to run the app on the device, I'm facing the following issue:
I the Event Log, there is the same message:
Where can I find more info about the error?
Might work if you Clean the project or rebuild the project and if you launching in emulator uninstall from the emulator or from mobile.
UPDATE:
i think there will be no more information about the error...
It's our common mistakes.
As per my knowledge about this issue there can be a few reasons for that:
First is that your app is already installed with the same package
name but with different certificate, To resolve this check if your
phone has that app already installed then uninstall it and try to
install new one.
The second reason can be that you are trying to install the
application that has minimum SDK version higher than the Android
version of device. To solve this make sure that the minimum SDK
version defined in your project's "build.gradle" is lower than the
Android version of your device.
Turning off the Instant run removed error for Android Studio 2.3.
sometimes project location contained the special character.
Example: E:\Android_Projects\T&PUIET,KUK\app\build\outputs\apk\app-debug.apk
close android studio > rename folder containing the special character(here T&PUIET,KUK ) > restart android studio.
Hope it will help!

Gradle sync failed

I am completely newbie for Android studio and Android development. Any help would grateful. I am using Android Studio version 2.3.3.
After I created a project I am getting below error.
Your latest installation of android studio 2.3+ doesn't have the dependencies , so you need to download it
1.) Connect to internet
2.) Run gradle synch or run your program
3.) Let the gradle download these dependencies
Note : it will be a one time process and will not be required for other projects
I had the same experience. I just used VPN and then let the gradle download dependencies(by clicking on sync button in build.gradle).For me it wasn't needed to change any proxy settings in android studio.
Thanks all for your quick response!!
To my surprise this has started working connecting from personal internet. Still wondering why it was not working with office network!!

Android Studion Dependency resolving hangs

I'm trying to learn building android apps, but I have ran into the following problem.
After I create a new project, the Gradle build starts and it is hanging at the following process.
I am inclined to believe that the connection that I use blocks several ports and it is impossible for the studio to download the necessary file.
Knowing this, I downloaded gradle from their homepage, and I've set the local path in android to that folder, but there is no change.
This is what I get after the gradle build times out.
What can I do to bypass my connection settings and build a proper project?
If you have enough traffic,you can open you mobile hotspot ,then computer connect to the wifi.So,create a project and Gradle,have a try!The junit package isn't very big.Hope can help you.

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.

Categories

Resources