Access SHA-1 or Gradle tab from Android studio - android

I am trying to access my project's SHA certificate fingerprint, but the steps to take from Stack Overflow do not work. Specifically, there is no Gradle tab on the right when I go to gradle.properties. There is no option for displaying it in View->Tool Windows. There is no pop up text that shows up when I select gradle.properties for opening this. There do not appear to be updated instructions for how to access Gradle tab on the right of Android Studio.
The other option I found is to get it manually, but is that the only way to do it nowadays?

I can only speak for Linux, but this might as well work on a Mac.
Click tab "Terminal" and then run:
cd android
chmod +x ./gradlew
./gradlew app:signingReport

Open the Gradle Tab from here:
View -> Tool Windows -> Build.
Here you go!
OR IF THIS DOESN'T WORKS:
Seems you're working on a Flutter Project
You can right-click on project- or android-folder, select Flutter->'Open Android module in Android Studio'
Refer this Image
After that the gradle-tab appears on the right and you can use it as intended.

Related

Android studio Gradle Tab

I've started to work on an android project that has many Gradle tasks. After cloning the project from git, there is no Gradle tab in Android Studio!
Hit Ctrl+Shift+A (for Win/Linux) or Cmd+Shift+A (for Mac) and type "Gradle". And click on "Gradle" item in the list.
I had to do the following (Windows):
go to File -> settings
change keymap to windows
Ctrl+Shift+A
search gradle and choose sync project with grade file
In a flutter project, it would not show when I opened the root folder, but if I opened the android folder underneath the root flutter folder, then the Gradle window appeared.
Most notably, Gradle did NOT appear as an option under View -> Tool Windows until I opened the correct folder.
If you downloaded a project but gradle did not exist inside it
You can copy the required files, such as gradle, from within another project
But if you mean, gradle tab is not visible at the right of the page
You can give new settings to the Android studio ->file->import settings -> choose your own settings.jar or you can enable this gradle tab from ->view->tool windows -> choose gradle
movafag bashid
If it has build.gradle file you can run gradle task from command line if you set path to gradle in your system path or you can have it set locally in project on which you are working on. Android studio has also on option to edit/add run configuration where you can also select what you want to do or run.
To list all possible tasks run command gradle tasks
I ran into this too. All the other answers assume you have Gradle installed and it's just a matter of finding it. This is what worked for me.
Open the build.gradle file in android/app/src/
There should be a small bar at the top of the code-editor. Click Open for Editing in Android Studio
That then will download and install Gradle into Android Studio, so you'll see the Gradle tab on the right.
For me going to the Build > Select Build Variant... and changing to some other active build variant showed Gradle tab
Your project should contain build.gradle file and if it is there then, there is gradle navigation tab on the right side in your android studio. When you click it, it will show you the tasks available and you can run your gradle tasks from there.

Gradle Terminal is not showing in Android Studio

The Gradle Terminal (also called Gradle Command Line) is not showing in my android studio, I have Android Studio version 1.3.1 and I have been searching for how to view the terminal for over an hour now and all I get are tutorials about how to use it and not how to show it so that I can eventually use it.
Anybody got a solution for this? Thanks in advance.
Not sure if there is such thing in Android Studio.
There is Gradle console and Terminal for sure.
Anyways, there is Find Action... command and you can use it to find "all" kind of things in Android Studio.
Just go to the Help menu and you will find it there. Here it's second menu option right after Search. Use this option to search for commands/features in Android Studio, like on the following image:
As you can see there is Gradle Console available and if you search for the terminal you will find Terminal option as well. But no Gradle Terminal or Gradle Command Line ;-)
check View - > Tool Windows - > Terminal in android studio
Although I did not find any solution to open the Gradle Terminal in Android Studio 1.3.1, I found an alternative way that lets me execute Gradle tasks outside the terminal. Go to Gradle console -> Gradle icon that says Execute Gradle task -> a pop-up opens -> attach your project -> write the task in the second field -> ok.
Happy Coding :)
Click "View" option top on the Android studio then click "Tool Windows" after "Gradle"; that's it.
View--->Tool Windows---->Gradle.
If you are looking for the gradle build output, you need to activate the "Build" Tool window.
Click View->Tool Windows->Build
click search on right side of ide - > type gradle - > gradle window will be opened
Very simple

Android build application: gradlew does not exist

This is the first Android application I am running. I am reading up the tutorial and following it (as much as I can).
I would like to get myself comfortable with the CLI instead.
I created a project using "android" executable. Although to build the application it says to run the "gradlew" executable which is supposed to be in my project's root. I don't see it there.
What might I be missing ?
Created the project using
android create project --target 1 --name HelloWorld --path HelloWorld --activity HW --package com.developers.helloworld
Indeed, it does not exist, because when you create a project from the command line, the generated project is an Android project without gradle.
You have 3 options however:
Use the official IDE supported by Google - Android Studio - to build and run your apps. (recommended), or
Download and install Ant and
a) Change directory to your project root.
b) Execute from command line ant debug to compile your project.
c) Then adb install YourApp.apk to transfer the apk to your device (once compiled successfully, apk you'll find in the bin directory), or
Manually add Gradle to your project. But keep in mind that Gradle is a build tool that expects a project to have a specific directory structure, if you don't want to configure anything.
In general, is good to know what happens behind a shiny IDE, and know let say, how to generate an android project on your own, from the command line. This also is useful when you want to use an IDE of your preference, or have more control over the Android build.
But, honestly, if you are just getting started with Android, I would highly suggest you use Android Studio. With this option you get an intelligent code editor, implicit support for Gradle, access to a multitude of open source projects from Github that already use the gradle project structure, and other advantages.
UPDATE: how to view logs:
from command line: adb logcat
from GUI: navigate to <android-sdk>/tools, find and open monitor.
Once the window opens, you'll find a tab called LogCat, usually located in the left - bottom of the window, but if it is not there, then go to: Window -> Show View -> Android -> LogCat -> OK, to add it.
note: make sure only one device is connected to adb bridge
for filtering:
check this & this.
The tools/andoird create project has the --gradle flag to specify to use the gradle template instead of ant template.
Use tools/android create project help for more details.

Error "can't use subversion command line client : svn" when opening android project checked out from svn

I'm new to Android development and the development tools around it. I have checked out a project from svn using TortoiseSVN client (can't manage to do it from within Android Studio), then get this error message after importing the project to Android Studio:
can't use subversion command line client : svn
Probably the path to Subversion executable is wrong. Fix it..
When I click "Fix it" link, this dialog pops up:
But I still have no idea what I am supposed to do to fix this? Any kind of help/suggestion/direction to fix the problem are welcome.
Android Studio cannot find the svn command because it's not on PATH, and it doesn't know where svn is installed.
One way to fix is to edit the PATH environment variable: add the directory that contains svn.exe. You will need to restart Android Studio to make it re-read the PATH variable.
Another way is to set the absolute path of svn.exe in the Use command client box in the settings screen that you included in your post.
UPDATE
According to this other post, TortoiseSVN doesn't include the command line tools by default. But you can re-run the installer and enable it. That will add svn.exe to PATH, and Android Studio will correctly pick it up.
This is annoying, I wish IntelliJ would handle this better than a startup nag..
If you are using TortoiseSVN 1.8+ on Windows, do this:
Run the the TortoiseSVN Installer. (It may still be in your Downloads folder)
Select the option to Modify.
Install Command line client tools on to the local harddrive.
Add C:\Program Files\TortoiseSVN\bin to your Path environment variable.
Restart IntelliJ.
Saw your problems.
Solutions:
First Download Subversion 1.8.13 ( 1.8 ) client
Download link (https://subversion.apache.org/packages.html)
at the time of this post the android studio version is less than 1.4
in my case 1.3.2 so you must avoid the issues here subversion command line client version is too old so just download the 1.8 preferably.
Then unzipped in a folder. There will have one folder "bin".
Then
Go to settings - > Version control -> Subversion
Copy the url of your downloaded svn.exe that is in bin folder that you have downloaded.
follow the picture:
Don't forget to give the end name like svn.exe last as per image.
Apply -> Ok
Restart your android studio now.
Happy Coding!
First install TortoiseSVN. During installation follow this steps
1.Run the the TortoiseSVN Installer.
2.If you have already installed svn, "Select the option to Modify".
3.select the check box "Install Command line client tools on to the local harddrive".
4.Add C:\Program Files\TortoiseSVN\bin to your Path environment variable or press CTRL+ALT+S in android studio. Then go to "Version Control"-> Subversion -> General -> Check the Checkbox "use commmand line client" and set the path to C:\Program Files\TortoiseSVN\bin\svn.exe
5.Restart IntelliJ.
In Android studio1.5 version when you try to add the file in your project,
android studio will ask for a pop like "schedule for Addition"
to subversion?. select the check box (Remember, don't ask again) and click "yes".
After this whatever the file you add or remove to your project it will automatically
synced to your svn repository. suppose if you didn't get that dialog, but you want to
add the newly added .png or xml file to svn means you can manually select those files
which you have added (the newly added file will be in red color) right click
on that file -> subversion -> Add to VCS or simply select the file and use (CTRL+ALT+A).
In the image green color(logo_actionbar) represents to file was already added to svn, red represents yet to add in svn. cool..!
If you want to change the "Schedule for Addition" setting means, Go to Settings -> Version Control -> Confirmation -> When files are created
Choose Show options before adding to version control
I use the IDE Phpstorm,but I think it maybe the same as AS.
1.You should reinstall the svn. And choose option modify.
And next step,you can see the command line client tools.
Let's choose first one: Will be installed on local hard drive.
2.Now restart you computer.
Go to the svn location,all the time it will be C:\Program Files\TortoiseSVN\bin.
If you see the svn.exe in C:\Program Files\TortoiseSVN\bin,it proved that we reinstall command line client successfully.
Copy C:\Program Files\TortoiseSVN\bin\svn.exe into the IDE.
3.Restart you IDE.It is ok!
If you are using ubuntu, check weather subversion is installed or not.
If not then install through command line as
sudo apt-get install subversion
and check following configurations are selected
I have fixed the issue after upgrading existing svn client on mac OS X with following link:(1.7.x to 1.9.x)
https://ahmadawais.com/installing-svn-subversion-on-yosemite-after-removing-the-old-version/
Open Android Studio
Go to Settings -> Version Control -> Subversion -> General -> User command line client ( Marked checkbox)
replace ‘svn’ with your svn installed path like ‘/usr/local/bin/svn’
While installation of Tortoise SVN.
Just change the command line svn tool setting.
Step 1: Click on command line client tools
Step 2: Select first option (Will be installed on local hard drive)
Thats it. Happy Journey.
[N.B: Images are copied from others solution]
i have fixed the issue by just downloading the android command line tool
from https://www.visualsvn.com/downloads/
download apache comand line tool
unzip it on drive
go to your android settings/version control/subversion
and make sure only command line option is enable
set the path of svn.exe as shown below
C:\Users\viratsinh.parmar\Apace SVN client\Apache-Subversion-1.8.13\bin\svn.exe
now in your android studio update the project , you will be able to commit now.
you can contact me on parmarvirat#yahoo.com
i was also getting the same Error, if you are using TortoiseSVN-1.9.5 just do two step Process
1:Click on TSVN.exe tool and
2:Select there on Second Window the Command line for Save on Local Drive with giving the path
3:Click ok
Now Restart You Android Studio/IntelliJ
There are better answers here, but how I fix this may be relevant for someone:
After checking out the project from SVN, instead of choosing the 1.7 version, I chose Subversion 1.6 and it worked.
Installing Subversion for Windows should solve the issue.
Please see my answer here - https://stackoverflow.com/a/31627732/3433133
If you using windows, you can fix it via install SVN Tool.
If you using Linux/MacOS, you can fix it via install subversion.
After that, just select using svn command.
Your problems is resolve.
Under Linux, got same problem after Android Studio update (and several months without using it...).
I solved it by running the following command in a console:
mv .subversion/ .subversion.bak
I prefer that command to rm -R .subversion since it left me a rollback option.
On Ubuntu 20.04:
sudo apt install subversion

Linphone Android how to import the library project?

I am working on SIP application and using Linphone Library.
I am trying to make and run the build on the device but getting few issues
I have setup the Android SDK and NDK set up on my Mac.
Now when i copy the repo via Terminal using command
$ git clone git://git.linphone.org/linphone-android.git --recursive
And than to Makefile ran this code:
$make
and Then it show's Build Successfull.
Now i need to import this project into Eclipse and when i do this imported project (folder named "linphone-adroid") into my Eclipse it shows me alot's of projects i am confused which one should i use and if i choose all of them then it gives me lot's of errors in other's (Shown in image below)
liblinphone-android --> Ran this on Device runs fine but when i call the numbers it changes it's view and shows duration 0:00 and does not calls the numbers then i have to press hang off button to dismiss the call. (Not able to make call's)
Please suggest me how should i import this project into my eclipse and what else scripts i need to run on the terminal to make it run.
So far what i have did is right or wrong?
Yes , it worked finally.
After build using "make" command.I installed in my device using "make install". Also generated sdk using "make linphone-sdk"
And then simply imported in eclispe just like normal android project.
Without any error it worked. - thank god.
In windows8 cygwin created many issues, so i did build the code using "make" command in MAC. And then simply imported in windows eclipse. (some admin permission issue in MAC)
Note: android-ndk-R9c was failed my build. So then i tried with android-ndk-R9 without additional toolchain it worked great. Android-ndk old versions available at
(http://page2rss.com/0dc3a880ab1762303011d69d18408917).
after building the library you have to import it in eclipse
File -> New -> Other... -> Android -> Android Project from Existing Code -> Browse_your_project
Now open your application (Project which have activity) and assign linphone library which you have earlier loaded....
Right click on your project -> select Android tab from left hand side -> from the bottom library section, click on "Add..." -> you will see the listed library which you have in your eclipse workspace -> select correct one -> click "OK" -> now refresh and clean the project -> build and try to run
check complete guide on linphone android on coders hub.
As suggested by #bhavana
I was doing wrong while importing the linphone-android project into my eclipse.
The correct process is explained below-
Importing into Eclipse :
After i have made the build then now i just need to import the project into eclipse.
Step1: Go to eclipse click on File Menu then Import then select
Existing Android Code into Workspace
Hit Next and Browse to the linphone-android project folder
And Only tick linohone-android folder and Leave copy project into workspace untick
Like the below image:
And hit finish.
Now i right clicked on "linphone-android" (project name) and go to Properties and Java Build Path and then Order and Export and then reorder them as my image below and untick gcm.jar
Hit OK
And Boom No errors
Now just run it on device or emulator. (Cross check minimum target SDK matches with the device or emulator.)
The above steps worked fine for me.

Categories

Resources