After following http://docs.phonegap.com/en/2.5.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android to create a PhoneGap Android project like so:
./create ~/Dropbox/eclipse_workspace/DOTD_UK uk.co.dasque DOTD_UK
Using Eclipse (Android Developer Tools) v21.1.0 to create a new Project from Existing Code, I get the following:
Invalid project description.
/Users/ed/Dropbox/eclipse_workspace/DOTD_UK overlaps the location of another project: 'DOTD_UK'
Any idea?
Unless you have a sure backup you can use, save the core files (assets, src, res, manifest, etc) and create another one. It's easier (and much faster) than fixing all references...
Related
I have an existing Android project.
Also, I created a new flutter project. I copied my project to it. Now I have such tree in the file system:
my_flutter_project/
android/
my_android_module_name/
src/...
lib/...
ios/...
When I try to run flutter project I have such error:
No application found for TargetPlatform.android_arm64.
Is your project missing an android/app/src/main/AndroidManifest.xml?
So I should somewhere write my_android_module_name instead app but where?
I'm fairly sure that a lot of the flutter stuff is hard-coded to use the :app project and app directory, not just the manifest (See the gradle reader). You could open a bug in the flutter repository about it, but I don't imagine it's something that will be changed very quickly as it would be a fairly large change.
If you really want to use a different project structure, you could look into using a FlutterView - see this example. I can't guarantee that it still doesn't have the same requirement of using the app folder though.
I'd recommend renaming the module to app or creating a fresh project and just copying in the relevant files - it would probably save you time and frustration in the long run if you're committed to using flutter.. They update the android & ios files occasionally, and if you have the same structure it's a lot easier to merge in the changes.
I would like to know if there is a faster way than the following steps to test Unity app with Android (gradle export):
Change something in unity
Build settings & Run --> Export (new Gradle)
Now the old gradle in the Android project is replaced, so i need to copy paste from a backup
The Res folder is also replaced, so I need to copy paste the backup one
Finally Build and Run the APK on the device
Steps 3 and 4 are obviously what makes this process painful (slow), I found the manifest.xml of the Unity android plugin, so this one stays the same (edited it directly in Unity). So am I doing something wrong ? Is there a way to update only parts of the Android project (like, if I only changed one line of a C# Script, just rebuild this one for Android)
Tell me if I'm not clear enough with my explanation :)
EDIT: I Already posted this in Unity forum but I didn't get any answer yet after a day
You can create your own Gradle file.
Put it in Plugins/Android folder and call it mainTemplate.gradle
It will use that.
As far as I know, there is no way to rebuild just part of it.
Unity does not create java files from the c# code. It creates its own modules and uses them directly.
BTW, why are you exporting at all? Why not compile directly to your device?
I just wanted an additional answer for this question even though it is a bit old (just in case anyone else in the future is wondering about this like me). I personally need to make use of both Android Studio and Unity so making a plugin wasn't really an option for me.
Now I have a custom gradle file as explained in the accepted answer. However I have also added an additional resource folder (Explained well by Android here: https://developer.android.com/studio/write/add-resources.html).
You basically just have to edit your custom gradle file to add paths to both resource directories. Add the resources you don't want Unity to overwrite to the other resource folder.
Now every time you rebuild to the project the resources remain and you don't have to copy them back in.
You can export a formal Android project first, using this project to build your final apk.
Then You could write an EditorUtil script in you Unity project, The script does following things:
1.export an temporary Android project to another folder.
2.copy assets folder and jnilib folder or any other folders you want to replace in your formal Android project.
Everytime you want export your project, just trigger the export function in you Unity Editor, It will copy and paste folders automaticlly, then your formal project will be ready for building.
I'm very new to Android. Whenever I create a new project using a new workspace, I get an exclamatory red mark in Eclipse in my project and an error at Appcompat. I searched here for an answer, but no answer was what I was looking for, so I just asked this. When I create a workspace at DDMS it displays this:
Sending Tracking request failed!
At Android, after I create a new project
WARNING: unable to write jarlist cache file here, src file, layout file not available.
I've searched a lot and found no solution.
OK, first thing first. Eclipse is no longer supported by Google. The only official IDE for Android Development is Android Studio Download Page.
Here is the announcement of Eclipse support ending
Over the past few years, our team has focused on improving the development experience for building Android apps with Android Studio. Since the launch of Android Studio, we have been impressed with the excitement and positive feedback. As the official Android IDE, Android Studio gives you access to a powerful and comprehensive suite of tools to evolve your app across Android platforms, whether it's on the phone, wrist, car or TV.
To that end and to focus all of our efforts on making Android Studio better and faster, we are ending development and official support for the Android Developer Tools (ADT) in Eclipse at the end of the year. This specifically includes the Eclipse ADT plugin and Android Ant build system.
Please note that the number of people using Eclipse to develop Android apps are going down. You will get less and less support even on Stackoverflow as time goes by. Overall, it is better to just make the switch while you are just starting.
Check on the first link, you will see some amazing documentation in the Android Studio IDE
If you 100% required to use Eclipse...
OK, so you have a job that requires Eclipse or there is some other reason, then check out this documentation by Eclipse.
Also, here is a list of all the different icons that can be displayed by Eclipse (credit for the icon list).
Build path problems are sometimes easy to miss among other problems in a project. The Package Explorer and Project Explorer views now show a new decorator on Java projects and working sets that contain build path errors:
The concrete errors can be seen in the Problems view, and if you open the view menu and select Group By > Java Problem Type, they all show up in the Build Path category:
Please refer this link too here
If you go to appcompat_v7/bin folder, you'll see that file "jarlist.cache" doesn´t appear or is unsynchronized. You need to
refresh the appcompat_v7 folder, only press F5 over that folder.
The appcompat_v7 folder is added because you use an action bar
component.
Aah. To avoid a new appcompat_v7_XX folder when you are creating a new
project, choose a LEVEL API 14 as Minimun Required SDK. After you must
modifier the AndroidManifest.xml and put the level that you need.
change it
android:targetSdkVersion="19" />
Delete all appcompat_v7_XX. It is a bug.
With appcompat_v7, You will see that Eclipse creates two XML files:
Activity_main.xml and fragment_main.xml. If you want to have an option
to create a project in the old way only with activity_main.xml, do
that:
Make a copy of the folder "BlanckActivity" located in this path:
\sdk\tools\templates\activities of an ADT previous version.
Rename the folder as “BlankActivityNoFragment”, then edit the field
name of the file "template.xml" with a notepad as
name=”BlankActivityNoFragment”
Copy the new folder in the same path of the new Eclipse
IDE:sdk/tools/templates/activities
Now you´ll see the new template when you go to create a new project.
Remember to choose as Minimum Required SDK an API 14
If you don't want the support of appcompat library then just remove it from your project by following steps :
Right click on project
Select properties
In dialog select android on left side
In dialog check library section
Remove appcompat library by selecting it and press remove
Extends your MainActivity.java with Activity
You can run your project successfully.
If you want the support of appcompat then follow this steps :
download the latest appcompat using Sdk Manager
import appcompat project in your eclipse
add it as a library project
extend your MainActivity with AppCompatActivity.
If you're getting any problem with app_compact library... This is the solution
Hopefully it will work....
According to the documentation
Decorates Java projects and working sets that contain build path
errors
There can be several reasons. Most of the times it may be some of the below reasons ,
You have deleted some of the .jar files from your /lib folder
You have added new .jar files
you have added new .jar files which may be conflict with others
So what to do is we have to resolve those missing / updating / newly_added jar files.
right click on the project and go to properties
Select Java Build Path
go to the Libraries tab
Remove the references of the jar files which you have removed already. There will be a red mark near them so you can identify them easily.
Add the references to the newly added .jar files by using Add JARs Refresh the project
This will solve the problem if it's because one of the above reasons.
Still Facing problem ??Try this:
Go to Windows -> Preferences -> Android -> Build and uncheck "Skip packaging and dexing until export or launch" then restart Eclipse.
I made a custom framework.jar for my device. This new framework include a new API which I'd like to use in my apps. Unfortunately, besides I included my own framework.jar in java build path, eclipse didn't see my new API and throw compiling time errors.
How can I configure eclipse to use my custom framework.jar instead of the jar within android SDK?
[EDIT]
Based in #Yuri 's answer and some other insights, I created a tool (actually it is a shell script) to create a new platform in android SDK and merge jar files into it. It's available in XDA forums to download as well the instructions to use: http://forum.xda-developers.com/showthread.php?t=2619775
To build SDK you should run the following commands:
make update-api
make sdk
Since the API of Android has been modified the command make update-api adds new API. The command make sdk creates SDK in out folder.
Then to start develop your applications in Eclipse using new SDK you should add this new SDK. There are 2 possibilities to do this. The first one is from the book "Embedded Android". I'll just copy it here:
Assuming you had already configured Eclipse for Android development
using the in‐ structions at http://developer.android.com, you’ll need
to carry out two additional steps to use your newly-built SDK. First,
you’ll need to tell Eclipse the location of the new SDK. To do so, go
to Window→Preferences→Android, enter the path to the new SDK in the
”SDK Location” box, and click OK. Also, for reasons that aren’t
entirely clear to the author at the time of this writing, you also
need to go to Window→“Android SDK Man‐ ager”, deselect all the items
that might be selected except the first two under “Tools” and click on
“Install 2 packages...” Once that is done, you’ll be able to create
new projects using the new SDK and access any new APIs you expose in
it. If you don’t do that second step, you’ll be able to create new
Android projects, but none of them will resolve Java libraries
properly and will, therefore, never build.
As for the second here it is:
Find you new build sdk zip (for Linux it cab be found here
out/host/linux-x86/sdk/)
Unzip this pack into a folder
Inside this folder you can find the directory which is called
platforms/android-2.3.3
Rename folder android-2.3.3 to <your_name>
Copy this folder into the following location of the installation of
your SDK Manager: android-sdk-linux/platforms
Find inside this folder file build.prop and assign to the property
ro.build.version.sdk any negative number:
ro.build.version.sdk=-10
Now run SDK Manager and you'll notice that you new sdk is added.
Simply create new Eclipse project and select this sdk as a target.
Try this:
create new floder in your project put floder name="libs"
and include the library here.
And Run the app
I hope it's working
This is a good question! Your tip would be useful for Android Studio users as well, I guess.
Just FYI, for IntelliJ users, you can also do this:
Project Settings > Modules > click Dependencies tab > click "+" button > select "JARs or Directories"
Find the .jar and choose it
Move the .jar on top of the list of Dependencies (even before the SDK)
Change the scope to 'Provided' (not 'Compile')
By step 4, you can avoid making a huge .dex. (Your apk will not include the framework.jar.)
I finished a "base app" for all my next apps in eclipse, with admob, contact us...
Can i sort of import this project in a new app and work from there? Or just copy and paste everything and just change the name? How? Like just start a new app with every thing like that app and the work it out from there?
thanks
You can turn your base app into a Library project (see http://www.vogella.com/blog/2011/03/03/android-library-projects/) and your other apps will include this library.
One gotcha with this is that the AndroidManifest.xml from your library is ignored, so you may need to manually copy activities, services, etc. from your library manifest to the real manifest.
I would put my "base app" project in a code repository (git in my case), and then just clone it, change the output name, libs etc in any build scripts. Check that into a new repository and keep working from there.
If you don't use git/svn/whatever just copy your source files and create a new project in eclipse, it's probably easier and less error prone than copying the project files as well and trying to remember all the places that refer to your old project.
Might be a little off-topic but what I usually do is I have pure source (and some build scripts) in a code repository and then outside that (in my eclipse workspace) I create the eclipse project and link the source files into my project. So if I trigger builds with eclipse I get the build output in my project directory while keeping my source directory clean.