Very new to Android development and am running into some issues with basic stuff. I've been using Eclipse to build my projects. Recently I upgraded to the latest version of the eclipse ADT plug-in v15.0.0 and in the process also had to upgrade my Android SDK to v15.
Now when I build my application there is no apk file generated. A dialog box with a progress bar appears with messages indicating that something is getting built. There are no errors but in the end I do not see an apk file in the bin directory or any other directory under project.
I have tried the following
- deleted project from Eclipse and re-imported the project
- deleted project from Eclipse and made a new project from exisisting source
- deleted project from Eclipse, removed code from workspace, re-synced to code from server and created a new project from existing source
To make things simple I tried building the hello-jni example that ships with the NDK and observed the same issue; dialog shows build with no errors but there is no apk. The suggestions in the threads below did not fix the issue for me.
Android Eclipse - Could not find *.apk
Unable to run Android app, Could not find .apk issue in eclipse
Details about my set up below
Java 6 Update 27
JDK 6 Update 27
Eclipse 3.7.1
ADT Plugin v15
Android SDK v15
Win 7 (32-bit)
The only thought I have is to uninstall and then reinstall the SDK. Seemed like it might be worth checking with the more experienced folks before I did that. Please let me know if you have any suggestions.
Try cleaning the project and then running
android update project --name <project_name> --target <target_ID>
--path <path_to_your_project>
from the command line. Then try building again.
Also, go to your project properties in Eclipse and go to 'Builders' and make sure that you see 'Android Package Builder' as one of the builders listed there..
Related
I'm on Android Studio 4.1.1. I created a new project and haven't added anything to the starter code and whenever I click build or run, I get this error:
Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager.
I am using android studio for the first time and wanted to print a simple hello world program , and this is becoming pain in the ass.
Please try the following instructions (assuming you are working on MS Windows):
Firstly, locate your SDK folder, e.g. %ANDROID_SDK_ROOT%.
Copy (NOT Rename) %ANDROID_SDK_ROOT%\build-tools\32.0.0\d8.bat to %ANDROID_SDK_ROOT%\build-tools\32.0.0\dx.bat
Copy (NOT Rename) %ANDROID_SDK_ROOT%\build-tools\32.0.0\lib\d8.jar to %ANDROID_SDK_ROOT%\build-tools\32.0.0\lib\dx.jar
Verify if build issue has been fixed.
I'm trying to build Terminal Emulator for Android. I'm running Android Studio 1.4 in Kubuntu 15.04. I also tried building it in Ubuntu 14.04 LTS with the same results. The project requires the latest Android NDK, SDK 22, and SDK 11 which I've downloaded and configured in Android Studio. My system gradle version is 2.8, and Android Studio has downloaded some other versions internally. I'm using jdk1.8.0_65, which is set to JAVA_HOME and configured in Android Studio. I've built several other projects with my configured Android Studio and only seem to have a problem with this project. I need to use this project as a base for an app I'm developing.
I end up with same error, posted below, no matter what route I take to fix it in Android Studio. This is generally what I've done to try and get the project to work. I open up the project unmodified in Android Studio. I click Build >> Rebuild Project. I get an error telling me ndk implementation is deprecated. I add a file gradle.properties to the root directory of the project with the line android.useDeprecatedNdk=true and rebuild. It gives me an error: Task 'generateDebugTestSources' not found in project. I execute Sync Project With Gradle Files to resolve it. Then I end up with the following error and can't get past it.
Gradle 'Android-Terminal-Emulator-master' project refresh failed
Error:exception during working with external system:
or
Gradle sync failed: exception during working with external system:
Consult IDE log for more details (Help | Show Log)
idea.log
Things I've done to try and get the project to build:
Modify all of the project's build.gradle files to use the experimental plugin
Use different versions of Android Studio
Switch from openjdk to Oracle's jdk
Upgrade gradle to the latest version
Set gradle to default wrapper (default) and also set gradle to different versions
invalidate cache, remove ~/.gradle, and rebuild project
Make sure PATH includes the gradle and jdk bin directories and is in ~/.bashrc, ~/.profile, and ~/.zshrc
remove proguard from libtermexec library
reboot computer
I should note that the project builds without issue on the command line. I'd really like to get the project to build in Android Studio for development.
Install Arch and run Android Studio there.
I decided to try building Terminal Emulator on my Arch server, so I installed a xfce (Desktop Environment) and Android-Studio through pacman. I followed the same general path to get things setup, and the app built without issue.
The idea log Android Studio generated for the failed build on Windows and Ubuntu didn't point to any clear problem, even with --stacktrace enabled with gradle. I'm not going to waste my time figuring out why gradle doesn't want to build apps in Ubuntu or Windows.
I have been thinking of starting an Android Development project. I searched on Google for it, it asked me to first install the Android SDK. On visiting http://developer.android.com, I discovered that downloading the SDK only will make it a bit difficult for me to manage the projects, so I downloaded the ADT bundle, which had the Eclipse IDE included with it. On testing it, I am finding the SDK to be working properly, but the Eclipse IDE wasn't starting, asking me to install a Java Runtime Environment. Installed that too, copied the jre directory to the eclipse folder, then tried to run eclipse.exe, got an error saying
Failed to load the JNI shared library
"C:\Users\Tanmay\Desktop\adt-bundle\eclipse\jre\bin\client\jvm.dll".
Please suggest me what shall I do to make the Eclipse IDE work, as working with the SDK through the command line is too tiring..
When I try to build my project in Android Studio I get the following error, using the gradle plugin provided with the download (v 1.6):
The specified Gradle installation is not supported by this tooling API version (1.6, protocol version 4)
When I downgrade to gradle 1.3, 1.4 or 1.5, I get this error:
Gradle: : java.lang.ClassNotFoundException: org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
The project was originally created in Eclipse, the exported using the build gradle file option, then imported into Android Studio.
Does anyone know what I can do to fix these issues? Many thanks.
I had a similar problem and I believe that it was caused by having multiple versions of gradle on my machine. The solution I found was to use the script that Android Studio creates in your project folder (either gradlew (MacOs/Unix) or gradlew.bat (Windows)):
./gradlew assemble
This causes the correct version of gradle to be run - i.e. the version that was shipped with Android Studio.
I haven't tried creating a project within Eclipse, so I'm not sure if these scripts are created when creating your project in that way.
I think the problem is with the way Eclipse 22 exports the project. In the end the way I got my project transferred over was to create a new project in Android Studio and copy over the files from my Eclipse project into the appropriate directories in the new project.
The directory structure of projects in Android Studio is very different to the structure in Eclipse, and there are several files created when you start a new project which you don't get when importing a project from Eclipse (e.g. gradlew.bat, settings.gradle).
I also had this problem which can indeed be worked around with Mark's suggestion of using ./gradlew assemble.
However, this does not help you run Make Project from within Android Studio.
To do that, I had to go to Preferences / Gradle / Use local gradle distribution
and select any random (but NOT gradle) folder inside the project folder.
You might notice that this is marked as an invalid location, but you can ignore that, it seems...
Not a great solution, but it works.
I'm using NetBeans for android application. I installed properly (I think) ActionBarSherlock package as android library project. Everything works fine, I can build and run application, but code editor doesn't recognize ABS classes (just look at screenshot, BUILD SUCCESSFUL but errors exists) and code completion doesn't work too.
My configuration:
Stable NetBeans 7.2 with android plugin ver. 1.13
Linux Mint 13 Maya 64 bit, Mate
ActionBarSherlock ver 4.2 (stable)
How I installed ABS:
Download and extract source
From sdk/tools run command:
./android update project -p path_to_ActionBarSherlock/library/
Similar command to connect android project library with my test project (there is similar option in Netbeans IDE but I get error that this is not android library project)
./android update project -l path_to_ActionBarSherlock/library/ -p path_to_my_test_project
I have tried clean and build on both projects but no results. Any idea?
Regards
The way I finally managed to add ActionBarSherlock to my android project on Netbeans was to:
Download the latest version of ActionBarSherlock and unzip it
Go to the subfolder called library and remove the pom.xml file from there (with one of the previous versions it didn't work. I had to first build it, close it and remove not only pom.xml but also some netbeans properties files)
Open that subproject (library) in the Netbeans
Now this project will no longer be seen as a maven project. Netbeans will see it as an Android project. Then I:
Clean&build it
Add it to my-project's library properties (right-click on my-project, properties, library, add, point the proper location of library project). Important here was to copy/move that library project somewhere near my-project. Otherwise it claimed that it cannot open it.
And from now on it works fine.
Key to that thinking was that Netbeans didn't want to add the provided library project cause it saw it as a Maven project. When the pom is deleted, Netbeans no longer sees it as Maven project nut as an Android project and it can without any objections add it as an Android's project library.
Probably there are better solutions, but I didn't find any and that was the only one working for me.
Hope it helps.
You can also make a new Android project, and then copy and paste the needed files in the new project.
So only copy:
libs, res, src, AndroidManifest.xml