How do I import an AIDE project into IntelliJ? - java

"AIDE" is an IDE for Android. It handles Java, Native Development, HTML dev, etc.
More specifically, I am trying to understand how I import a template LibGDX project started in AIDE, and open the project for running in the normal IntelliJ IDE, not the specific JetBrains Android Emulator version.
I imported the project, but cannot understand how to compile and execute the project, and I suspect I have imported the project incorrectly.
Can anyone help me to understand the process for this?

For IntelliJ 15, you must click "Import Project" on the into screen:
You then locate the ".project" file under "gdx-game" (or "gdx-game-android", but eventually you need to add both), and select it.
You will then configure the project settings, such as directory. You select
"$project_name$" if it is not already checked. You will also click
"Open Project Structure After Import":
Enter the name for the main project, and select the main SDK for the project:
You now navigate to the "Modules" section, and then rename the module ("project") from "$project_name$" to "gdx-game" (if you are in fact currently importing the "gdx-game" project).
You must also select the proper Module SDK to use in compilation of the project.
For "gdx-game", this would be a normal Java SDK such as Java SDK 1.7.
For "gdx-game-android", this would be "Project SDK (Android API 21 Platform)" by default, but if it does not appear you can select "Android 21 Platform(java version "1.7.0_79")":
You will now click the addition symbol, also pictured above (circled in red in image 4), in order to import the next module of the project ("gdx-game" or "gdx-game-android").
Again, you will navigate to the appropriate folder and locate the second ".project" file.
Upon import of the module, rename it in the same manner as you did with the first module. Alter it's SDK as well.
This should be all you need for a basic import of a project, but you may need to add libraries and such, depending on your projects needs obviously.

Related

IntelliJ IDEA - "Imported project refers to unknown jdks JavaSE-1.8" while import Eclipse projects

I tried to import Eclipse project to IntelliJ IDEA, but I got this error:
The eclipse project description contains a reference to a "manually" defined JDK (named JavaSE-1.8).
Just go forward and define an SDK for your project within IntelliJ yourself. See here for the necessary steps:
To define a JDK and a mobile SDK in IntelliJ IDEA
Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S).
In the leftmost pane, under Platform Settings, click SDKs.
Above the pane to the right, click  and select JDK.
In the dialog that opens, select the installation directory of the JDK to be used and click OK.
... (obviously you don't need the Java ME mobile specific things listed in the original link)
Here they had a similar problem, but with android sdk
You must edit Project SDK in Project Structures > Dependencies to existing Java JDK

The import android.support cannot be resolved

I am trying to run the code provided HERE
I downloaded the code from their Github and imported into Android SDK, but it shows error at the lines
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
in multiple files. However if I check the Android SDK Manager, the Android Support Library as well as the Android Support Repository in the Extras folder are both installed. I can also see the support folder and it's contents in the SDK_INSTALL\sdk\extras\android\support directory. It also has the v4 folder which also contains the android-support-v4.jar and the src folder. THen why is it still showing the error, how do I resolve it and how do I get that sample code running? THe sample code is for an RSS reader app, if that's relevant.
Follow these steps:
For Eclipse:
Go to your Project's Properties
Navigate to the Java Build Path
Then go to the Libraries tab. There click the Add External JARs Button on the Right pane.
Select the android-support-v4.jar file, usually the path for the Jar file is :
YOUR_DRIVE\android-sdks\extras\android\support\v4\android-support-v4.jar
After adding android-support-v4.jar Library, navigate to the Order and Export tab and put check mark on the android-support-v4 Library file.
After doing the above, Clean the Project and Build it.
Problem Solved.
For Android Studio:
Short Version:
Add the following line to your build.gradle file:
implementation 'com.android.support:support-v4:YOUR_TARGET_VERSION'
Long Version:
Go to File -> Project Structure
Go to "Dependencies" Tab -> Click on the Plus sign -> Go to "Library dependency"
Select the support library "support-v4 (com.android.support:support-v4:YOUR_TARGET_VERSION)"
Navigate to your "build.gradle" inside your App Directory and double check if your desired Android Support Library has been added to your dependencies.
Rebuild your project and now everything should work.
Further reading regarding this Question:
Support Library - Android Dev
Recent Support Library Revisions
Support Library Packages
What is an Android Support Library?
How do the Android Support Libraries work?
andorid-support-v4.jar is an external jar file that you have to import into your project.
This is how you do it in Android Studio:
Go to File -> Project Structure
Go to "Dependencies" Tab -> Click on the Plus sign -> Go to "Library dependency"
Select the support library "support-v4 (com.android.support:support-v4:23.0.1)"
Now to go your "build.gradle" file in your app and make sure the android support library has been added to your dependencies. Alternatively, you could've also just typed compile 'com.android.support:support-v4:23.0.1' directly into your dependencies{} instead of doing it through the GUI.
Rebuild your project and now everything should work.
Another way to solve the issue:
If you are using the support library, you need to add the appcompat lib to the project. This link shows how to add the support lib to your project.
Assuming you have added the support lib earlier but you are getting the mentioned issue, you can follow the steps below to fix that.
Right click on the project and navigate to Build Path > Configure Build Path.
On the left side of the window, select Android. You will see something like this:
You can notice that no library is referenced at the moment. Now click on the Add button shown at the bottom-right side. You will see a pop up window as shown below.
Select the appcompat lib and press OK. (Note: The lib will be shown if you have added them as mentioned earlier). Now you will see the following window:
Press OK. That's it. The lib is now added to your project (notice the red mark) and the errors relating inclusion of support lib must be gone.
For me they were appearing when i transferred code manually to another laptop. Just do
File>Invalidate Cache/Restart
click on 'Invalidate Cache and Restart' and your are done.
I followed the instructions above by Gene in Android Studio 1.5.1 but it added this to my build.gradle file:
compile 'platforms:android:android-support-v4:23.1.1'
so I changed it to:
compile 'com.android.support:support-v4:23.1.1'
And it started working.
This issue may also occur if you have multiple versions of the same support library android-support-v4.jar. If your project is using other library projects that contain different-2 versions of the support library. To resolve the issue keep the same version of support library at each place.
I have resolved it by deleting android-support-v4.jar from my Project. Because appcompat_v7 already have a copy of it.
If you have already import appcompat_v7 but still the problem doesn't solve. then try it.
This is very easy step to import any 3rd party lib or jar file into your project
Copy android-support-v4.jar file from
your_drive\android-sdks\extras\android\support\v4\android-support-v4.jar
or copy from your existing project's bin folder.
or any third party .jar file
paste copied jar file into lib folder
right click on this jar file and then click on build Path->Add to
Build Path
even still you are getting error in your project then Clean the
Project and Build it.
Android Studio 2.2.3
Linux Mint 18.1
Inside your 'project view' open Gradle Scripts -> build.gradle(Module:app) and put your mouse pointer inside the word dependencies.
Click on the light bulb and click "add library dependency" and for me all the libraries I wanted were listed there.
example libraries that came up for me:
compile 'com.android.support:gridlayout-v7:25.1.0'
compile 'com.android.support:support-v13:25.1.0'
I am now looking to add android support by default in Gradles default configuration.

Could not find xx.apk

I am a very beginer, trying to create my first Android application.
To do so, I use Eclipse and an AVD. I created my very first Class (called "Test") and when I run the project it says "Could not find Test.apk!"
I had a look at many solutions an internet:
- delete and import
- clean up my project (I have only one class so there is not much to clean
And it still does not work.
Do you have any idea about how to proceed to fix this up?
Many thank for you help.
You don't give much information to know what's wrong. What steps did you take to create this application?
Does your class Test extend the class Activity?
If it does, is it declared in your project's AndroidManifest.xml file?
Also, make sure that your project is not set up as a library project. Right click on your project's name, select Properties->Android and make sure that IsLibrary is not checked.
Possible solutions:-
Sometimes the apk file is not generated simply because there are some
android build error in your project, In this case, right click your
project, choose Android Tools -> Fix Project Properties.
Is your project termed as library, in this case, Go to
Project->Properties--> Select Android from left-hand side list -->
Uncheck the "Is Library" checkbox
Delete R.java file then clean build project or restart eclipse, this
will force the workspace to be rebuild.
what version of eclipse are you using, version of Eclipse
using(Ganymede – 3.4) is not compatible with the latest version of
the SDK. Try updating Eclipse..
Hope this helps..

In-App Billing Android and bug

Good evening, everybody.
I'm trying to debug the In-App Billing project. The sourse which I use, is
https://github.com/blundell/SimpleInAppPurchaseV3
I'm facing the problem from time to time:
Suddenly the project in file Log.java gives two errors:
1. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
The error shows near the first symbol of the file.
R.java cannit be resolved! And gen-folder doesn't recreate! No errors in xml-files.
IabHelper.java shows the error: The import com.android.vending.billing.IMarketBillingService cannot be resolved
So if delete com.android.vending.billing/IInAppBillingService.aidl file and recreate it (by copy-paste) nothing happens.
What am I doing wrong?
I think your problem is just the latest update of the SDK.
Test the following operations on two projects :
In the project properties (eclipse) -> java build path -> order and export make sure that all your jars in the libs folder are checked.
And "Android Tools -> Fix Project Properties"
And "Project -> Clean"
If your problem persists try this:
Remove your project
Close eclipse
Import your project again
I hope you have helped!
Try this one.
1) project properties-> java build path-> order and export
make sure you have checked true all files that I have listed below:
Android Private Libraries,
Android Dependencies,
your all jar and libraries you have added.
2) check your SDK manager you have updated all required versions for
--> Tools: SDK Tools, SDK platform tools, SDK build tools.
--> Android 4.2 or what ever you are using, Google Map and SDK Platform should be updated latest.
--> Extras: Google Play Services,Google play billing libraries
also make sure you have not imported wrong variables or any class.
Hope it will help you.
Simple solution.
Rename your package name from com.android.vending.billing to com.android.vending.billing2.
Refresh project.
And after that again rename to com.android.vending.billing. And it will work.
In Android Studio click "Make Project" after adding "IInAppBillingService.aidl" file to your project. Then Android Studio can import "IInAppBillingService" class after press Alt+Enter on IInAppBillingService class.

Running Android Support v4 Library Demo Programs

I'm interested in running the Android Support library demo projects for the v4 library.
Using the Android SDK manager I've installed the Eclipse plugins, and APIs from 2.2 to 4.0.1. There are several issues involved, and the sample project as provided is far from running on my configuration, as downloaded.
To reproduce this error:
Install SDK and Eclipse Juno
Import the sample v4 compatibility project using File --> New --> New Project and choose "from existing code", targeting, for example, the Support4Demos folder in <Android-sdk-path>/extras/android/support
Open the file AccessibilityManagerSupportActivity.java. The following errors appear.
Open res/values-v11/styles.xml. The following errors occur.
How do I get rid of these errors? I'd also like to understand why they are appearing so I can fix them in the future.
Thanks!
Clean solution is to:
Right-click your project.
Choose "Android Tools"
Choose "Add support library".
Install the appropriate support library (the newest)
I can't really answer you on the why this problem happens, but I'm guessing the Android team doesn't supply the Android support library, because it's changing all the time, so not to get stuck on some older version, they want us to supply it on our own.
If errors still persists or new errors come up, right-click the project again and choose "Android tool" -> "Fix project properties"
Update: In conjuction to my answer, the way to remove the rest of the errors is to import the project another way than you did.
Select File -> New -> Other
Click Next
Write Android Sample
Select Android sample Project and click Next
Now add the Android support librarys as described above.
You will get errors still however. To fix these, do the following:
Right-click your project and select "Properties"
Select Android
Select an SDK version equal to 3.0 or above
Select Ok and clean the project from the project menu.
All done ;-)
Now you won't be able to run the sample project on devices lower than Android 3.0.
The reason is because of some dependencies on some themes and settings, that wasn't added before Android 3.0 apparently.
It doesn't make sense why Google did this, but they did. You could try to remove the SDK +11 (Android 3.0) specific dependencies, but it will take some time - there are more errors than you actually see - especially in the XML files.
You have to add the v4 support library.
In order to do that , please follow these steps :
Select your project.
Click on Project from the menu.
Select Properties.
Click on Java Build Path.
Select the Libraries tab.
Click on Add External JARs.
Select the main directory of the Android SDK that you installed, then go to extras -> android -> support -> v4 , and then select android-support-v4.jar and click on Open.
Click OK.
This should remove the errors.
Please check your libs folder has android-support-v4.jar is present or not. if not add this jar file in libs folder.Just copy the android-support-v4.jar from any project and paste it to the libs folder of your project
I spent a whole night on this but can not solve this problem.
I finally solved the by accident: change some file in the demo and save, then change it back, this cleared all the errors. I think when you change some file and save, eclipse build the project and generate the R.java.

Categories