After selecting “Profile or Debug APK…” to open an existing APK, pressing the “Debug” button gets us to the “Edit Configuration“ windows with the “Error: Please select Android SDK” message.
If we still select “Debug”, and then select “Continue Anyway” in the “Change Configuration Settings” windows, the error notification from the main window is “Error running ‘com.appname’: No JDK specified for module ‘com. appname’”.
I found the solution for myself. There are 2 places to check if the SDK was set correctly.
File-> Project Structure… -> Project Settings -> Project
Ensure that Java SDK is set under “Project SDK”. (for example, ‘9.0.1 (java version “9.0.1”)’)
Project Settings -> Project (tab)
File-> Project Structure… -> Project Settings -> Modules -> -> Dependencies
Ensure that your installed Android SDK platform is set under “Module SDK”. (for example, Android API 27 Platform (java version “9.0.1”)’)
Project Settings -> Modules (tab)
If the application is debuggable, pressing the “Debug” button will bring up the Android emulator selection windows.
Related
I am using android studio v1.5.1 on ubuntu. I have android API 16 and 23. I am trying to build a module using android studio but it complains that the android SDK is not specified.
When I open the project settings, I can see both android 16 and 23.
I cannot seem to figure out which one to select as default (or should I go ahead and delete the one I do not need).
You can set the (general) sdk location with:
- File -> Settings -> Android SDK (under Appearance & Behavior -> System Settings)
Also you can set the location for a project using:
- File -> Project Struture -> SDK Location
To set the level of the SDK, use your build.gradle file inside the module using:
android {
compileSdkVersion 23
//...
}
You can select more than one, like in screenshot below. They are packages that you have installed.
So no need to worry and no need to delete any similar will be in UBUNTU
I was able to get this done by using File -> Project Structure -> Modules -> Name of module -> Dependencies tab -> Selecting Module SDK -> Selecting the SDK I wanted to use (Android SDK 16) -> Apply. I was able to build the module after the change.
Recently i have been trying to transfer my javafx app on android mobile devices. Javafxports seens to be the way to do it, but I am looking for a quick way to do it through eclipse and not using the "command line", to go to a path and run gradle command. Can someone post a brief guide if there is such a way to build everything from eclipse IDE?
Thank you in advance.
How to use eclipse and gradle to install a JavaFX App on Android.
1. Download and extract e(fx)clipse ( I have downloaded the ALL_in One). I downloaded 4.4.
2. Download and install JDK 8u40 or greater from Oracle website. I downloaded v8u45 64-bit for Windows.
3. Download Android SDK Tools( I downloaded and extract android-sdk_r24.1.2-windows.zip)
Run "SDK Manager.exe" and install
(a) Tools -> Android SDK Build-tools 21.1.2
(b) Android 5.0.1 (API 21) -> SDK Platform
(c) Extras -> Android Support Library.
4. Download sample application of JavaFX and later extract it to eclipse "workspace".
5. Run eclipse and download Gradle Integration for Eclipse (4.4) by drag and drop from web to eclipse.
If that does not work go to
Help -> Install New Software -> Add... -> Location: http://dist.springsource.com/release/TOOLS/update/e4.4/ -> Core / Eclipse Integration for Gradle -> Gradle IDE
6. In Eclipse go to
File -> Import... -> Gradle |_ Gradle Project
(a) Browse to eclipse workspace where you have extracted "Sample Application from Step 4"
(b) Press "Build Model" button
(c) Choose JavaFXAndroid project and "Finish"
7. Edit "build.gradle" file and change androidSdk parameter to indicate the directory where you have extracted Android SDK Tools in Step 3
8. Check if the build runs ok on windows machine
In Package Explorer
Right Click on JavaFXAndroid -> Run As -> 2 Gradle Build... -> type "run" in the large editor and press "Run" button
9. Install it on an android with version > 4.
In Package Explorer
Right Click on JavaFXAndroid -> Run As -> 2 Gradle Build... -> type "androidInstall" in the large editor and press "Run" button
Note: Make sure that you have installed the correct ADB driver for your device and that your device is in developer mode.
10. Enjoy:)
i dont know how the plugins on eclipse are, but on intellij you got there is gradle plugins and it reads the configured tasks. So you can configured easily your own "run". I bet you can do it to with eclipse.
I am new to Ubuntu and Android, and I tried to install Android Studio and succeeded in that matter, but when I click Start a new project nothing happens. I tried reinstalling, but it didnt help. Any ideas?
EDIT:
i managed to create project manually using terminal, but in android studio I still cant create project nor edit existing project (some IDE error is thrown)
You should be more specific (screenshot or quotes of error), so try this:
In Android Studio, go to Configure -> Project Defaults -> Project
Structure -> Platform Settings (SDK) choose the Android SDK, set the
build target and click on apply.
After successfull installation of Android studio,sdk and jdk i was not able to open new project in Android in Android Studio on windows 7. This got resolved by doing the below settings,
Configure -> Project Defaults -> Project Structure -> Platform Settings (SDK) choose the Android SDK >click Apply and Ok.
You are good to go. Please note that you need jdk 1.7 to work with Android studio.
I'm running Eclipse 3.7.2 on a Win7 machine. I have the Android SDK and AVD. All was working well. I have an Android App project that I've run under the emulator on an AVD and on a real Android device. ADB worked fine as well.
At some point I grabbed SDK Android 4.0.3. Then I had to upgrade a few more things that I cannot remember, perhaps my AVD. But ever since this upgrade there is no option to run my package as an Android Application anymore. If I choose "Run" it throws up a menu asking me to select a way to run it and "Android Application" is not a choice. It has to be Java App, etc. If I open "Run Configurations" there is no "Android Application" in my left column.
My SDK manager still lists Android 4.0 and Android 4.0.3 as "Installed." My AVD Manager still let's me launch an Android virtual device and even create a new one. But Eclipse does not let me run my package as an Android Application.
Make sure you check for updates to the Android ADT plug-in for Eclipse in addition to upgrades for the AVDs, SDKs, and other debug tools. Then make sure you're in your Android perspective (upper left of Eclipse window), rather than some other/generic Java perspective (no Android-specific options).
Also, you can check under Window > Customize Perspective... in Eclipse to double-check that all the Android options (menus, context items, views, toolbars) you want are enabled.
UPDATE:
You can add the Android tools to any perspective (I named mine "Android"). From the DDMS or Java perspective, go to Window > Customize Perspective - DDMS. Click the Command Groups Availability tab, and make sure that "Launch" is checked.
Also go to Project > Properties > Run/Debug Settings and check that there is a Launch Configuration listed. Create/Edit that configuration and confirm that it has an Android tab (usually set to run the Default Activity from your Manifest).
If not, there may be something wrong with your project's association - try right-clicking on your Project in Project Explorer, go to Android tools (if available) > Fix Project Properties. I believe there's an Ant tool that can do this from the command-line, but you'd have to check the Android/Google docs.
There's also the possibility that something's off with your Eclipse installation or that you've got a newer ADT plug-in than your version of Eclipse. Eclipse Juno (v4.2) released at the end of June, and the most recent ADT plug-in may be looking for something that's not there in your v3.7 install.
What fixed it for me was:
Right-clicking on the Project Name in the Package Explorer
Android Tools -> Fix Project Properties
After that I was able to just Click Run As -> Android Application and all was well for me
Click mouse right button on your project -> Configure -> Convert ADT Android Configuration
An easy fix is to manually create an android run configuration:
Run / Run configurations..., then right click on "Android application" and select new, select your project and click Run.
I had a similar problem. What I finally did that worked was go into Project->Properties->Java Build Path->Order and Export and I made sure that the /gen files we're first in the sequence followed by the /src files.
I just installed the latest version of Eclipse and the Android SDK. In the Android SDK Manager I installed everything, and in Eclipse I installed the ADT Plugin.
If I choose new Android project, I can't choose any Build Target. How can i select different build targets?
Thanks for your help!
I had the same issue and had to go to Eclipse > Window > Preferences > Android to set the Android SDK location (C:\Program Files\Android\android-sdk in my case).
You can see this post: android can not find a target
and
http://www.mail-archive.com/android-beginners#googlegroups.com/msg17763.html
first of all select SDK manager in the android folder, then a windows pops up automatically in which certain packages are selected, from which you can select the platform on which you want to develop you application..... it will take some time to download those packages
Then go to preference(Eclipse) -> select android from the leftbar -> select target in the right bar -> got to the program Files - > select android -> select sdk -> Finish
Before running you application perform the following steps ->
-> select project name from the project explorer
-> select run as -> run configuration -> select android configuration -> select project name and activity name to start with -> Select target tab from the above -> it shows the platform which you have installed -> select that platform -> select run
don't forget i struggled with it, always mention the activity name in the manifest file otherwise what ever you program, it will never comes on emulator, but shows error....
You have to open the SDK Manager in the location in which you installed the Android SDK and download individual build targets depending on the Android version you want to develop for.
See Step 4 Here: http://developer.android.com/sdk/installing.html
Perhaps you've missed Step 4. Adding Platforms and Other Components at http://developer.android.com/sdk/installing.html . Pay attention on it.
To fix this problem, open SDK manager thru programs or eclipse. It will show available packages to download. In that list don't select the latest one. Select Versioin 2.2(API 8). Then install all sub packages (there are six) inside that.
the same error for me, Just activate "Automatic Updates" in eclipse, restart, install the new update of eclipse, you will be notified> now you can select in the preference android: your folder and all target will be there