I've been banging my head off my keyboard all day trying to figure out how to import one of the core/system apps in the AOSP into Eclipse to edit/debug it (in this specific case, the Settings app in Android 4.0.4).
I've followed numerous guides on the subject, including this one here which got me VERY close, but the code is still returning 167 errors.
Anyone have any experience or insight with this problem?
Thanks!
This is how I have done it. Use eclipse to edit/browse/debug platform code using an eclipse project. To build the platform, I use terminal and build the whole image or build specific folder (i.e. Using mm helper).
To create eclipse project for AOSP sources, please check Using Eclipse to edit/browse AOSP.
Related
When I try to build > generate signed bundle
AS complains:
Generating signed bundle requires you to update the Android Gradle
plugin to version 3.2.0 or higher
If I click on Close this dialog and update the plugin
A further dialog appears (AS Bumblebee) titled update the Android Gradle plugin If I hit OK, the dialog vanishes, nothing happens, and I get the same complaint when I try to build a signed app bundle again.
This is really frustrating because I can't upload an app with Googlemaps without signing it. That's my whole app!
OK well similar problems have been answered a few times on StackOverflow, but some of the solutions have become antiquated other solutions don't seem relevant:
I can see no way to update Gradle through File > project structure in Android Studio Bumblebee.
If I try and update Gradle manually in android/build.gradle, well it already has gradle 7.03, which is way above 3.2.0. Although Gradle and Android Studio's Gradle plugin may have different version numbers. See the code snippet below.
I've tried using Android Studio's search box with 'update Gradle plugin' to no effect.
I've hunted around Preferences > SDK tools, but no mention of a gradle plugin.
Instead of using an app bundle I've tried generating a signed APK, but that has problems too, and the file is larger, so no easy solution.
This is the relevant part of my android/build.gradle file:
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
}
FURTHER investigation, gradle-wrapper.properties contains this:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
Which is a different version number to my android/build.gradle:
classpath 'com.android.tools.build:gradle:7.0.3'
I'm not sure why they have different numbers.
This is the last hurdle for one app, and a roadblock in another, please help. I'm totally lost, I've begun to think maybe a Kotlin plugin upgrade has caused havoc somehow.
UPDATE
I've reported the issue to Google, via AS's help menu, and in doing so the report said this...
AS: Bumblebee | 2021.1.1; Kotlin plugin:
211-1.6.10-release-923-AS7442.40; Android Gradle Plugin: (plugin
information not found); Gradle: (gradle version information not
found); Gradle JDK: version 11.0.11; NDK: from local.properties: (not
specified), latest from SDK: (not found); LLDB: pinned revision 3.1
not found, latest from SDK: (package not found); CMake: from
local.properties: (not specified), latest from SDK: (not found), from
PATH: (not found)
That's a lot of things missing! Both gradle and the gradle plugin. I've tried creating a fresh project in AS Bumblebee then asking for a signed bundle but get the same complaint, so it's not because the projects have taken a while.
Any solutions are appreciated. I thought you just downloaded Android Studio and it was all good to go... sigh.
UPDATE attempted the solution offered below, but I do not appear to have a Gradle location set, as per picture...
Finaly solve this problem.
I trid all that way mentioned in the question and stell that dump error
it doesn't look logical. but its work for me.
I closed project in android studio then open android folder at my project folder in new a android studio window,
like this below
then it take long time for downloading, analyzing, or... something,
you can see the layout is not same as main project ....
also build menu has more options...
after that tried to build app bundle and everything is good.
I think generating app bundles is not possible in main project file. we need to switch to android folder and generating it.
after all these I searched youtube generate app bundle android studio flutter
https://www.youtube.com/watch?v=g0GNuoCOtaQ
in this building app bundle in another way that doesn't have these headaches
Well in the end I solved it. In the left hand project files pane I right-clicked on Android > Open in Android Studio, Gradle then took a long time reindexing the project and offered to update the project's Gradle version, which this time it did successfully. HALLEYUH!
I seldom push out signed apps, so I'd forgotten the process for doing this, and the fact that the AS Flutter plugin offered me the option of Tools > build signed app bundle within the plugin led me away from how I've successfully attained a signed app in the past.
I think really the Flutter team shouldn't offer this option if it's not going to work reliably, but the solution is to do it the old way. Change the IDE back into what I presume is 'Java app' view, and be patient while AS runs around fetching gradle and Android SDK updates, reindexing. Then seek Build > signed app bundle from there.
Thanks everybody for your attention, and apologies for wasting energies. x Sam
In Settings, 'Build, Execution, Deployment', 'Build Tools', 'Gradle' I had a 'Use Gradle From' set to a 'Specified Location' and it was breaking the build. It must have come from some previous version. I changed it to "'gradle-wrapper.properties' file" and everything went fine.
I also noted a much larger 'aab' file in Bumblebee. I know I added stuff, but not 8 megabytes worth. It was only code, and maybe a thousand lines.
I want to migrate the project in atmel-studio from eclipse cdt, as I started working on an embedded c/c++ project I understood that atmel-ice is not debugging properly in eclipse it's just helping me to flash firmware nothing more than that. So, Want to migrate my whole project to atmel-studio. So, I could debug it. Looking for help thanks.
As an option, look into the atmel-studio capability of debugging an externally produced elf. The tools I've used (keil, tensilica, IAR) all had ways to make a project that could debug an elf file produced externally. You may lose some magic like source parsing/intellisense or whatever, but I've found source line debugging works just fine.
I've never used Atmel Studio, but in searching the web, I found:
http://ww1.microchip.com/downloads/en/devicedoc/atmel-42167-atmel-studio_user%20guide.pdf
http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-ECD8A826-B1DA-44FC-BE0B-5A53418A47BD-en-US-5/index.html?GUID-4C53CCC3-659D-4030-A7FD-566B19C87747
Both of which say "File->Open Object file for debugging"
I am trying to learn about native Android, using NDK.
I find some sample projects in NDK folder and on the Internet. After much configuration, they are runnable.
But, my problem is: when I open a .c or .h file in JNI folder with Eclipse (just want to see what it is), Eclipse shows many error in this file. For example, it don't know what is JNIEnv, jobject, jstring.
I haven't made any change in the project, just opening it. Errors mean I can't rerun it again except if I delete it from the workspace then reimport it.
Eclipse does not work well with C/C++ files. At least, for me it did not.
After some search, I have managed to configure Code::Blocks to support NDK, please see this answer to the question:
Need a simple Linux C++ IDE (Android NDK) .
I'm just starting out with Android development and in general I keep hitting brick walls that seem to have more to do with the IDEs then the anything else. I started out with Eclipse but it kept corrupting my projects and other weird errors. Now I'm trying Android Studio which seems more stable but again a brick wall:
After following the android tutorial to the letter to create the hello world app I tried to add a new activity. The xml file was created fine but the java class file did not show up under src like it did in eclipse. What gives? This is demoralizing me. I long for the days of writing C code for microcontrollers using just an editor and cmd line.
Thanks.
Goto File -> Settings -> Compiler
check use external build then
rebuild project
Update your Eclipse ADT plugin, then export project and the import in Android Studio.
And follow the below link
http://developer.android.com/sdk/installing/migrate.html
I feel a bit stupid since I develop android apps for a while now. My problem is that I can't get the ApiDemos to work with Eclipse.
Please have a look at the screenshot of my errors I get in Eclipse:
http://cheat-database.com/android.png
It looks like it can't find the xml files in the ApiDemos project. Although everything looks fine to me.
Any suggestions what I might be doing wrong?
Other (own) Android applications work fine in Eclipse.
Thanks a lot for help.
Do this: In Eclipse, File->New->Project, then either type the word "sample" in the filter text field or select Android->Android Sample Project and you will see all the projects such as ApiDemos, NotePad, etc.
The R.java is an automatically generated file. It is updated/re-generated whenever layout files, etc are changed.
I'm going to assume you tried to set up the project directly from the samples. I've seen that cause issues with write access if you don't have the privileges, and it doesn't seem to play nice when I try it either.
One thing to try would be copying the relevant ApiDemos folder to an alternate location and then try creating a new android project from that folder as follows:
Create -> New Android Project -> Create Project From Existing Source
Then point it to the location and select the relevant SDK.
It's not ideal, but at least it might get the application generating and running possibly.
Clean the project and build it again...I hope it would solve the issue
when you File->New->Other->Android Project from Existing Code, you have to tick "Copy projects into workspace".
got the same issue today :-(
this way gave me a solution very easy to use with ADT (eclipse) :
click on New Project icon --> Project --> Android --> Android Sample Project --> Next --> Select Target (for me Android 4.4) --> Next --> and then select the sample project you want to import in Eclipse (for me : legacy > ApiDemo) --> Finish
it works fine for me, i hope that could help someone :-)
#+Mathieu