First build with AndroidStudio failed - java

I'm new to android programming and I'd like to use Android Studio for the start. I downloaded and installed AndroidStudio 0.8.0 on my Ubuntu 14.04 machine. I also set up java properly.
When I create a new project (as told by http://developer.android.com/training/basics/firstapp/creating-project.html) it looks like it will try to build the sample files. But then I always get this error:
/home/daniel/AndroidStudioProjects/Heimweg/app/src/main/res/drawable-xhdpi/ic_launcher.png
Error:Error: Cannot run program "/home/daniel/android/android-studio/sdk/build-tools/android-4.4W/aapt": error=2, No such file or directory
Error:Execution failed for task ':app:mergeDebugResources'.
/home/daniel/AndroidStudioProjects/Heimweg/app/src/main/res/drawable-xhdpi/ic_launcher.png: Error: Cannot run program "/home/daniel/android/android-studio/sdk/build-tools/android-4.4W/aapt": error=2, No such file or directory
How can I deal with this error? When I try to run the app it says »ADB not responding. You can wait more, or kill "adb" process manually and click "Restart"«

The Android tools need 32-bit compatibility libraries installed. I had the exact same problem, and this worked for me:
sudo apt-get install libc6-i386 lib32stdc++6 \
lib32gcc1 lib32ncurses5 lib32z1
Then restart Android Studio.

It sounds like the SDK doesn't have all of the components installed!
To remedy this, in Android Studio go to Tools->Android->Android SDK Manager
I would install the Android SDK Tools, Android SDK Platform-Tools, and the Android 4.4 files (and the others as far back as you plan on developing for)
I hope this helps!
Here's some reference with pictures if you need further assistance: http://developer.android.com/tools/help/sdk-manager.html
EDIT:
I apologize! I should have read your error more carefully. It seems that android-4.4W refers to Android Wear.
Make sure when you are creating your project that you do not have Android Wear selected under the SDK selection screen (As shown below)
Alternatively you can also open up the Android SDK Manager again and install the Wear SDK.
In the SDK Manager it is under Android 4.4W (API 20), install the SDK Manager and the two System Images

Related

Creating flutter plugin for android and ios gives error in java files android studio

I created a flutter plugin for android and ios using the following command:
flutter create --org com.docscanner.ds --template=plugin --platforms=android,ios -i swift -a java complete_pdf_tools
The operation was carried out smoothly and then I opened android studio and clicked on the option Open and selected the folder created by the above command. The project opened but it shows error everywhere in all the .java files.
And also all the folders and files on the left are in yellow except lib folder.
This is how it looks:
I tried Invalidate Caches and android studio restart and system restart but no good. If I move cursor on top of any red colored word for example on embedding in 3rd line it says Cannot resolve symbol 'embedding' and for actions it suggests Find JAR on web and if I click on that action it says looking for Libraries and then says No libraries found for 'import io.flutter.embedding.engine.plugins.FlutterPlugin;'
The error is in .java files only. Same thing happens if I try to create the plugin from android studio itself by going New Flutter Project>and then it asks me for flutter sdk path, which is C:\src\flutter>now for project type i select plugin and select java for android and swift for ios, give project name, org name and finish
I am using windows 10 x64, flutter version stable 2.10.2, and Android Studio version Bumblebee 2021.1.1 Patch 1
What could be the cause of these errors.
Open example/android/build.gradle instead of android/build.gradle, then you have both app and plugin in your Project.

Installing Android Studio on Mac OSX 10.12 fails to install android sdk

I want to do some android development.
I have a new macbook, on Mac OSX version 10.12.6
I go to https://developer.android.com/studio/index.html and download version 3.0.0.18 for the mac of Android Studio.
The download completes, I drag the app into my Applications Folder, and run.
Android Studio then shows this error:
This says the Android SDK is not found -- which is true I don't have one installed.
I click next and am shown this screen - which is where I find the problem:
The box on this screen says Android SDK - (installed) which is strange because the Android SDK is not installed. The screen suggests the android SDK location is /Users/me/Library/Android/sdk however this directory does not exist on my machine.
I click Next, then Finish and am presented with this screen:
Can somebody please help me -- Android Studio should download for me the SDK if I don't have one installed so why does it believe I have one when I don't?
I believe the problem here was a firewall blocking the outbound call to the download server, which was not reported correctly from the Android Studio.
Trying the install from a different location worked first time.
Its because you should run application behind proxy, pretty weird huh?
I had this problem when i clone repo with git desktop and same issue as you had.
First of all find a proxy.
https://hidemy.name/tr/proxy-list/?type=h#list
For git desktop you have to change your git config proxy:
git config --global http.proxy http://proxy.mycompany:80
So now you can clone with github desktop app.
And for Android Studio when you get Android Studio First Run dialog box click Setup Proxy and enter proxy and it will be fine.

Can't find SDK Manager in SDK file

I am being pestered by eclipse when I open the program. I get two error messages; "SDK Platform tools component is missing! ..." and "Failed to get the required ADT version number from the SDK. The Android developer toolkit may not work properly".
Both messages give me the option to open the Android SDK manager. When I attempt to open the Android SDK manager from eclipse, I get an initialization and then nothing happens.
I'm aware this is a common problem. Many solutions say to find the Android SDK manager in the SDK directory, though I can't find it anywhere there. The path I am using is "C:\Users\Ant\AppData\Local\Android\sdk".
When I attempt to open the SDK manager from Android Studio, I get something come up, though I have no idea if it is the Android studio version of the SDK manager or not.
All I want to do is install some packages to get everything running smoothly. I have the feeling that I need to open the SDK manager from eclipse to do it though. Is this correct? Is there anything else I can do?
You should go and create the proper environment setup, It seems there is a confusion between Eclipse and android studio working env. Please make sure to install separately the working env. SDK are normally hidden files make sure you are suppose to see hidden files in your computer.
Thanks,
Ashish

Android Studio error on Ubuntu: An error occurred while trying to compute required packages

I have followed the instructions on the official site.
But I am unable to install Android Studio. I'm getting error message "An error occurred while trying to compute required packages" as shown in the attached image.
Few months back when I tried to install Android Studio there are instruction in Android Studio official webpage to install Java JDK. Today I don't find any traces about it. Do I need to install any Java related file to fix the error?
Of course you need to install the Java Development Kit.
sudo apt-get install openjdk-8-jdk
... e.g. in the terminal should do the trick.
EDIT:
There's a manual workaround!
As per post https://stackoverflow.com/a/42733510/7694425 :
Download the command line tools, place them in the SDK folder (e.g.,
on mac: /Users/user/Library/Android/sdk), and then add the bin
folder to the PATH.
Install the latest platform: in a terminal,
execute sdkmanager "platforms;android-25"
Open Android Studio, and
go to the SDK Manager (Appearance and Behavior > System Settings >
Android SDK)
Click on "Edit", and then select the sdk folder. Then
"Next" > "Next" > "Finish".
Still, it doesn't resolve the missing emulator package therefore the Android SDK tools can't be updated since it's a dependency. But Android studio works and you can download other packages.
Looking forward to a better solution.
Update 2:
Solution to emulator package issue!
After digging in the repo's XML for a while I've spotted the issue.
It turns out that the "emulator" package is only in channel 3 (canary) while the "tools" package is in channel 0 (stable) but depends on "emulator". The solution is to force the manager to download the "emulator" package from channel 3:
./sdkmanager --channel=3 emulator
Problem solved!

Gradle Project Sync Failed - Android Studio

I have been working on an android app through android studio for about a month now. I recently got a new computer, and tried to open the app files on that computer. When I open it I get an error banner saying
Gradle Project Sync Failed. Basic functionality (e.g. editing, debugging) will not work properly.
When I click the try again button the error in the console reads the following:
Error:failed to find target android-21 :
C:\Users\compu\AppData\Local\Android\sdk
Install missing platform(s) and sync project
I don't have access to the computer I created this project on. Is there a simple way to fix this?
Try launching SDK Manager from AndroidStudio's menu icon then install Android 21 packages.
You need to download android-21 api
go to android sdk manager and download api 21
This is because you might be building a project say Android 5.1 , but you don't have the required SDK i.e. API 21.
Go to your SDK manager and check if you have the required SDK downloaded. For safety download API 21, and 22 and then create the program again and see if you still get the error
or change the target from settings which is available at yours machine.
Also where exactly have you put the SDK bundle folder the one you downloaded from Android website? On your desktop?

Categories

Resources