I have an android project consisting of multiple subprojects and one of those subprojects is network, the problem is debugging breakpoints doesn't work in the network library project and also Android.Util.Log doesn't work too, so i don't have any way to debug the project right now and that's really makes things tough while fixing some issues or adding new functionality in the project. On a breakpoint it says
no executable code at line 42
also when i load the project (the one containing all the other projects in android studio) it says can't load 3 modules fine, but they work when i run them.
Just wanted to know if anyone else is facing the problem and what could be the solution.
I have tried putting the .iml files in .idea/modules/network and it helps me get rid of the error of can't load modules. I've tried cleaning the project already and rebuilding it. Restarting android studio, upgrading android studio I am on the latest version of android studio now.
When i open the project in intellij idea ultimate it gives me message that unsupported projects, can't have java projects with gradle projects in android. But the projects i have are Andriod library projects with their own build.gradle files.
It sounds to me like what's happening is your application is being built with older compiled versions of the libraries. How are they included in the project, gradle dependencies?
To get logging in you would need to open the modules add the logging and re-build them.
Copying around .iml is not a good idea in general. The correct process is to do an import in Android Studio. Here is a pretty good tutorial http://www.truiton.com/2015/02/android-studio-add-library-project/
The last step about adding it to your gradle file to compile is important that is was will allow it to pick up changes, like adding logging.
Related
Like many a newbie I've been blindly clicking away in Android Studio 2 stumbling my way through building an app. Most of it just works so I've not really got my head into gradle.
Any road up, I've wanted to link into Strava and discovered that there were a couple of guys who had done the heavy lifting but on using a specific project, at the vital point of getting the data there is a coding problem. I thought the best approach would be to solve the problem and feedback.
So I downloaded the GitHub project in a zip and tried to do a standalone build and then things just didn't work. I think the basic problem is a) I don't know what I'm doing, and b) presumably the build on GitHub was done using different tools that are not set up for Android Studio.
So given that there is a working project on GitHub (specifically https://github.com/SweetzpotAS/StravaZpot-Android ) what are the dummy steps for getting that project to build locally in AS 2?
The problems I had are that on trying to open the project picking up the gradle file (couldn't find anything else to open in the root directory, the build didn't want to work - complaints about mixed projects. I stripped out the testing app and just tried to build the lib, but I didn't get a working lib in the output directory, just 2 25k stub aar files. Ideally I want to have that as a standalone project to build a local lib and then use that lib in my project (which I reckon is within my abilities!). Run out of Google search ideas!
I tried to build this project using JetBrains IntelliJ IDEA but it was unsuccessful (there were a lot of errors). The project has an Android.mk file, but I didn't see the C++ code.... How can I build this project? I've tried to use another IDE, then I tried building from the console but it was not useful. Perhaps, does Launcher3 need NDK to build it?
You'll need to isolate the launcher's code and then identify all of it's dependencies. If the code has any C++ code then it definitely requires the NDK and currently IntelliJ/Android Studio does not have any stable support for NDK based app development (though it is a work in progress) else if it is pure Java (most probably) then you'll have to manually add the classes and build the app from Android Studio! Either way you will have to dig deeper into the source and know for yourself. Unfortunately there seems to be no easier option, for now. I wouldn't mind being proved wrong for the matter.
EDIT :
I glanced through the code and I noticed there are no C++ source files or library (*.so) files. This isn't a gradle project and hence cannot be built as one. You'll need to setup a gradle based Android project and then begin adding the sources (src, tests etc.) and their dependencies (res etc.). You can start of here : Getting Started with Android development if you're new, else you can move to this : Gradle and Android
Just a quick question I did not find a good answer on. We are currently working on an APP created with Eclipse ADT Bundle. I recently started exploring Android Studio, and like it. Is it possible to still collaborate with my mates using Eclipse with a shared GitHub repo?
I noticed Android Studio converts the project to its own file structure, so I guess this does not go well with Eclipse, and the repo.
Is there any solutions for this? So I can keep developing in Android Studio, push to GitHub, while the rest of the team use Eclipse?
I think you can do it, you'll just have to explicitly define a sourceSet that matches the Eclipse structure. If you use any other build variants, they can't have any sourceSets because you wouldn't be able to check those files in to source control. However, there are several useful things you can do with build variants just with the build file. I think you can check in the build.gradle and other gradle stuff and it won't mess up your coworkers.
I have an Android Apps (A) project that depends on a Library project (B). The library project contains code as well as third-party jar files and some other jars that were exported from projects C and D. In Eclipse, I have project B specified as a library project.
However, when I connect my device and run project A (Run As -> Android Application), it crashes on the device and when I examine the LogCat output, there is a NoClassDefFoundError exception for one of the classes that exists in the jar files of project C.
When I unpack the B.jar file in Project B's bin folder, it does not contain anything else besides the META-INF/ folder with an empty MANIFEST.MF file. So this indicates that something seems to be going wrong someplace, but I'm unable to figure it out.
Could anybody help me with this issue?
Are you working with the latest ADT plugin and SDK revision? That is rev 22.x. If so there has been an important change to the dependency management.
Possible solution
For some reason the contents of the Order and Export tab has completely changed and you now have to export the Android Private Libraries from your library projects. See screenshot below:
More details
The tricky part of this change is that your project still compiles properly in Eclipse so you're not aware of any issues. Until you deploy the app on an emulator or device and you get the ClassDefNotFoundException on any call of a library project.
Not confirmed but I believe this is related to recent changes for maven support, also related to android studio preview
Similar change in the past
This reminds me of a similar change in the update to rev 17 where the lib folder suddenly changed to libs and all content from the original lib folder wasn't packaged so you wouldn't see any issues in eclipse. Only once installed on a device.
More information that 'issue' is available on this link. If you search on stackoverflow for "sdk 17" and "classdefnotfound' you'll also get enoug questions about that change.
I have a couple of non-android projects, one android library project and one android app project that depends on all other projects. Consequently, in the android app project I have a virtual MyLibrary_src source folder.
For some reason, when I'm doing refactoring in the library project, Eclipse partially executes it, but then fails with generic undo/abort dialog. I've found out that when I close the app project, refactorings complete without any problem. I suspect that the virtual source folder may be to blame, but I'm not sure.
Does anybody know how can I fix this problem?
With ADT v14 the problem fixed itself.