I have a Java Android project that includes JNI code written in C.
I often need to debug into the native code and before upgrading Android Studio to version 3.3 it was working.
Now in my project view I don't have any code in my cpp folder. I have confirmed that all of the C libraries are in the folder on my HDD. The CMAKE file is also missing from the project view but is also in the correct place on my HDD.
I have not changed any code from my source control since upgrading.
I am using
'com.android.tools.build:gradle:3.3.0'.
In the Build Variants section next to my JNI module I just have five dashes instead of the debug/production options.
I have uninstalled and reinstalled android studio too.
Is it possible after upgrading I need to add something to my configuration to correct including CMAKE?
I had the same issue, just figured it out. In AndroidStudio 3.3.1, they changed things around a bit I guess. Now you have to link your NDK build to the app you are building it as part of.
This is documented at: https://developer.android.com/studio/projects/gradle-external-native-builds
The section, "Use the Android Studio UI" is what you want.
I am thinking how to get Android' s support library to include and compile outside Eclipse. I am using Linux as my build environment and I am not using any IDE for creating apps, only the basic Android SDK. I have only come over answers to this question regarding Eclipse, but how can I do it using only Ant and Android SDK?
Assuming that you are not using GridLayout:
Step #1: Copy android-support-v4.jar or android-support-v13.jar from your SDK into the libs/ directory of your project.
Step #2: There is no step #2.
Choose android-support-v13.jar if you are using native fragments (versus the Android Support package's own backport) and you want to use them with things like ViewPager that are part of the Android Support package.
GridLayout makes things a bit more complicated, in that it is an Android library project. You would need to follow the instructions for how to use an Android library project in a command-line project, probably working off of a copy of the official project.
All of this stuff can be found in the extras/ directory of wherever your SDK is installed.
Similar to this automation article http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html
Make sure to generate a valid build.xml file for ant/android building android update project --path /path/to/project
then just ant clean debug
You can also checkout the official doc http://developer.android.com/tools/building/building-cmdline.html
I'm writing an android app that uses both ActionBarSherlock and the Facebook Android SDK. Both these libraries provide android-support-v4.jar in their libs folder:
https://github.com/facebook/facebook-android-sdk/blob/master/libs/android-support-v4.jar
https://github.com/JakeWharton/ActionBarSherlock/blob/master/library/libs/android-support-v4.jar
However, in the head revision both versions of the support jar are different. This causes builds of my app using eclipse to fail.
I'm using both libraries by including them in the repo of my app as git submodules. One solution would be to fork one of these libraries, update the version of android-support-v4.jar in the fork, and point my submodule to the fork. While perhaps this is the right way to go, somehow this feels wrong.
I wanted to know if there were other alternatives before I use the above method. A number of popular Android libraries seem to use maven, is using maven a good solution for solving this problem, and a good idea for android apps in general?
First of all Delete android-support-v4.jar from All(yourProject,FacebookSDK etc. ).
Then follow below steps:
Right Click on Project -> Android Tools -> Add Support Library and The again Right Click on Project -> Android Tools -> Fix Project Properties do same on Facebook SDK and Other Libraries.
and Clean-Build all your projects(Facebook SDK,your Project and Libraries).You are Done.
I have implemented the new Facebook SDK 3.0 beta. The library project contains the Android support library v4. I also have the support library on my own proyect (a different version though). When I add the Facebook SDK as a library I get the next error on the console:
Jar mismatch! Fix your dependencies
Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.
I've tried to exclude the libs folder on the buildpath, but the error remains.
I have to put the same .jar in both places. Am I missing something here? The idea is to use the support library of my own project (to keep it updated).
It seems like the different projects are using two separate support libraries and therefore the checksum is different.
You must repeat this for both the Facebook SDK project and the app you are building.
What I do when I get this error is:
Right click the project.
Hover over Android Tools.
Click on "Add support library..."
Accept the downloading of the library.
This insures two things: a. you get the newest version of the support library from the Google sources, and b. you have the EXACT same library in all your projects.
Happy coding!
Simply delete the one in your project, remove it from the class path and try rebuild your project.
Installing the same version of support libraries via menus mentioned in the top answer is quite a good solution.
Although this sometimes didn't work for me (I think it has something to do with my Workspace folder being synced with Dropbox, so Eclipse won't overwrite files sometimes) so the approach I am using is to link the support library from the central place.
There are these JAR files inside your SDK folder (C:\Program Files (x86)\Android\android-sdk\extras\android\ on Windows for example) which is being updated when you run SDK manager, so you could just reference that one from both the Facebook (or any other library) and your projects. Since in the end, code from JAR files gets packed to your classes.dex. You don't even need the support library in the libs folder.
Also: If you use the Gradle build system and its dependency management or even Maven you will not have problems like these, but they require more time and knowledge to set-up correctly.
Whenever i am trying to run my project, i am getting this error in the console.
"Could not find **.apk"
Operating system: windows XP
IDE: Eclipse SDK
Version: 3.4.2
Build id: M20090211-1700
Android: 1.6
ADT: ADT 10.0.0
FYI: it is only happening with a single project, other projects are running fine..
I think this can happen when you rename the library project out from underneath the dependent project. Eclipse is reasonably good about about updating dependencies in most cases but this one seems fragile.
First try removing and then re-adding your library in Project > Properties > Android > Library.
If that doesn't work try cleaning your projects, exiting Eclipse, and opening the ".classpath" file in your project's root directory. If you see a line that references your library project under a previous name, just delete it, save the file, and relaunch Eclipse. Build the library project and then your dependent one. You may need to re-add the library like I mentioned above. This is what worked for me at least.
Edit note: I also found some stale references in my .project files. They didn't seem to be causing any problems but I removed them too. If you do that, be sure to search for the old name in that file as there was a whole "link" section near the bottom that also referenced it.
Make sure after updating your android sdk sdk build tools are updated properly.
You can check it by Open sdk manager -"Android Sdk Build Tools" status must be installed.
if the status is not installed then install Android Sdk Build Tools for the same.
restart your eclipse and try again
check this it might be helpful to you
Make sure your project imported the Android 1.6 library correctly. That is, under your project, you should see 'Android 1.6', which expands and displays 'android.jar'.
If it says Referenced Libraries > android.jar, you will need to fix this by manually altering the .classpath for the project.
Open .classpath for the project and type the following:
The important line is the 3rd classpathentry, which is the actual link to the Android SDK libraries.
source
clean your project and check . eclipse is not building apk file.
check this thread. It might help you.
http://groups.google.com/group/android-developers/browse_thread/thread/2c3e45540b915945/f06e10bcda3ad68b?lnk=raot&pli=1
Run eclipse as administrator and then import your project
Update Android SDK, is what did it for me.
I was building a game with the LibGdx Framework and got the same error. I tried several solutions from various posts at stackoverflow and others.
Found help in a post at the LibGdx Forum:
http://www.badlogicgames.com/wordpress/?p=3010 Posted by Mario, on May 18, 2013
Just updated to ADT 22, so should you. However, the process wasn’t all that smooth. What you need to do:
Update the ADT plugin in Eclipse (Help -> Check for Updates)
Open the Android SDK Manager, either from within Eclipse, or from
your Android SDK folder
Fetch all the updates
Fetch all the updates again
Fetch the updates one more time…
The end result should be an updated ADT plugin, as well as up to date SDK packages. Make sure you have all three of the ones in the following image, with the exact version numbers.
I needed to update them only once and from there on it worked.
Even if this post is outdated I figured I'll share this, because I lost a day finding nothing.
I experienced that problem, too, when I created an android project that was using an android library. Obviously I didn't know how to incorporate a library into an application the right way. I wrongly used project dependencies (Java Build Path/projects) or adding a library (Java Build Path/Libraries). While all I had to do was go to the Android tab and import my android library by means of the add button from the Library section.
I am using PhoneGap and I checked several solutions about configuration (properties, build path). However, my problem was that I tried to run everything with the default setup for Eclipse. Then, I solved it going to the SDK manager to install: Android SDK Build-tools, and it worked.
Mine was caused by this problem (incompatibility between ADT and SDK), and was fixed thus:
Eclipse > Help
Install New Software
Add 'https://dl-ssl.google.com/android/eclipse/' to 'Work With'
section and press enter
After developer tools appears on the list, check it and click Next
Restart eclipse once download is finished
Make sure put correct SDK Location (I have 2 instances of SDK and update wrong once).