That's it, actually. I prefer not to use Eclipse, and want to use the command line.
I've tried to just build it without doing anything special, but it gave me errors like:
package com.giderosmobile.android.player does not exist
cannot find symbol AudioDevice
etc.
Also, if it's possible, I'd like to use another IDE and use the command line for the entire process. Is this possible? If yes, how?
This is my first question here on SO, so please correct me if I'm asking it wrong.
Well first, I noticed that there was no included ant build file, and it was missing several other things. So first things first...
{sdkdir}/tools/android update project --path [locationToProject]
Will generate your build files and everything else.
But it looks like from trying to build this failed because it wants to import location
com.giderosmobile.android.player.*
You might be missing that dependency or the package is named incorrectly...
[Edit]
I swapped this line:
import com.giderosmobile.android.player.*;
with
import com.giderosmobile.android.player.AudioDevice;
import com.giderosmobile.android.player.JavaNativeBridge;
And it built just fine using 'ant debug'. Hope that helps!
[Edit 2]
Move "gideros.jar" into the libs folder
Related
I need help. I'm trying to install and configure OpenCV 2.4.7 library in my computer (Ubuntu 12.04). After run OpenCV samples appears those errors in my Console:
Cannot run program "/NDK-build": Unknown reason
Error: Program "/NDK-build" not found in PATH=[/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]
I've seen numerous tutorials and nothing worked. I ask you to be very specific since I am "new" programming and also because my mother tongue is not English (I have some difficulties). Thank you!
Easiest Method which worked for me is.
Goto the Project Properties
Click on C/C++ Build (An other list will open)
Click on the Environment from the list
Now click on Add
Here you have to Put 2 values
Put Name as NDKROOT
In Value put PATH TO THE NDK FOLDER
You are done :)
Same case happened with me (when my NDK location was already set), so changing to original Android Builder removed my problem for doing so simply go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.
Do you have android-ndk installed? If yes, add path to ndk-build to your path.
e.g:
export PATH=$PATH:~/android-ndk/bin
Add the ndk-build to your path
Follow this guide
http://my.safaribooksonline.com/book/programming/android/9781849691529/setting-up-your-environment/ch01lvl1sec18
this is a frequent issue with openCV for Android. It stems from having the incorrect build target, which creates an error within the library for the Video.java file. After getting that patched up, you can import sample projects. Although, after fixing that, you may not be able to see the C/C++ Build node under project preferences. There's a fix for that on the second link. However, if under project preferences you can see C/C++ Build, make sure the path reads: "${NDKROOT}/ndk-build" Finally, it will be looking for NDKROOT,which is undeclared. The third link will direct you on how to do this, it's very simple. ALSO, make sure if your on MAC or LINUX to remove the .cmd from the end of NDK-BUILD. Good Luck!
Video.java issue:
http://answers.opencv.org/question/8266/opencv-library-244-on-eclipse-gives-error/
C++ Build/General Missing from Project Preferences:
http://stackoverflow.com/questions/16953548/eclipse-missing-c-c-build-and-general-from-project-properties
Now, make sure you add NDK root to the build varialbles so you can find it:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Ftasks%2Fcdt_t_add_build_var.htm`
I have been working my way through the Tab menu tutorial and have come across multiple errors. After doing some research on here I found the common solution was to change the Import android.R to import com.example.myfirstapp.R.
This is giving me the error that this file cannot be resolved. Can anyone tell me why I can't import this file? I have a hunch from researching on here that eclipse has not built the file, but I have no idea how to build it as I am new to coding as this is just a hunch and may be completely wrong.
package com.example.myfirstapp;
[Edit}
i have removed the "com.example.myfirstapp.R" and have CMD-SIFT-O to restore the imports but i still have the following errors.
You don't need the com.example.myfirstapp.R unless it is in a library. If it is in com.example.myfirstapp, remove it.
Also, trying cleaning your project and rebuilding it.
Make sure you don't have any files, pictures, etc in your drawable or assets folder with capital letters, spaces, or dashes. Just use plane old lowercase. Also, try to clean your project. Go to project > clean. Then restart eclipse. Hope this helps. Also eclipse won't reconize any changes in XML files without saving first. Make sure to save after you add a button, ect.
I am currently migrating an Eclipse app to Android Studio.
This app was using the in app billing.
My main problem is to compile the project and the aidl file (I guess you all use this file)
I get this error message:
Gradle: error: cannot find symbol class IInAppBillingService
Gradle: error: package IInAppBillingService does not exist
So, following some tutorials, I move this file from com.mypackage.billing to src/main/aidl
(see this reference)
But as soon, as I do that, I get this message:
Gradle: Execution failed for task ':xxxxxxxxxxx:compileDebugAidl'.
Failed to run command:
(...) C:\Users\xxxx\AndroidStudioProjects\xxxxxxProject\xxxxxxx\src\main\aidl\IInAppBillingService.aidl:45
interface IInAppBillingService should be declared in a file called
com\xxxxxxxx\billing\IInAppBillingService.aidl.
The message is clearly a contradiction with the post from the Google bug page I linked above.
Anyone suceeded to make this aidl file to work and can help me?
Just to inform, some links I followed:
http://tools.android.com/tech-docs/new-build-system/user-guide
http://developer.android.com/guide/components/aidl.html
Adding this as an answer since it seemed to help quite a few people.
Create a new directory named 'aidl' under 'src/main/'. It should look like 'src/main/aidl'.
Add a new package name 'com.android.vending.billing' to the directory 'src/main/aidl'
Locate your sdk location and go to "sdk\extras\google\play_billing". Default location for the sdk is "C:\Program Files (x86)\Android\android-sdk". If you custom changed it, then you will have to figure out the location through the sdk manager.
Copy 'IInAppBillingService.aidl' into the package created above. In the end, it should look similar to the image below.
Rebuild project and it should be good to go.
Note: Make sure you include the necessary import if your reference isn't working
import com.android.vending.billing.IInAppBillingService;
https://issuetracker.google.com/issues/36973270
Edit From Comment
After I did this, the references to IInAppBillingService in my code were still highlighted as errors, but after rebuilding the app, the class was recognized
Just as the error message says, you need to put IInAppBillingService.aidl in the correct directory dictated by it's package (com.android.vending.billing).
Within the src/main/aidl/ folder you already have, put the .aidl file in com/android/vending/billing/.
Create new directory under src/main called aidl
Right click on directory aidl, select new->add package
Enter Name of the package com.android.vending.billing
Copy IInAppBillingService.aidl from the directory Android/Sdk/extras/google/play_billing to the directory App_name/app/src/main/aidl/com/android/vending/billing
Now go ahead with InApp billing coding and while defining InApp related services you will get an error can not resolve symbol IInAppBillingXXXXXX
Now goto to Build from android studio menu , click on Rebuild Project. This will generate IInAppBillingService.java file inside App_Name/app/build/generated/source/aidl/debug/com/android/vending/billing. This will solve the issue.
The rest of posts here didn't work for me till I created a new folder like shown here.
Add this code in build.gradle
android {
sourceSets {
main {
aidl.srcDirs = ['src']
}
}
}
Rebuild and import aidl class
The above answers concentrate on file location, but it appears you already had that set correctly. I experienced this same issue in Android Studio, but none of the listed answers resolved it, and I banged my head against it for an hour. Eventually, I realized that I was missing an obvious import:
import com.android.vending.billing.IInAppBillingService;
Once I added that it resolved this error message.
This import isn't mentioned in any of the Google Billing docs or included in any of the code examples that I found. While it may be obvious to experienced Java developers, beginners just trying to learn their first project may need it explicitly pointed out.
We need to add
create folder - src/main/aidl/packagename and place aidl file under this.
In the aidl file - mention the package name.
package packagename
Now clean the project, rebuild the project - We can the corresponding java file for the aidl generated in app\build\generated\source\aidl\debug\packagename\youraidl.java
I know it sounds so easy, but I copy paste from google sample all folder
https://github.com/googlesamples/android-play-billing/tree/master/TrivialDrive/app/src/main
aidl/com/android/vending/billing
copied into project aidl ( I had set project view in Android Studio)
and next I clean and rebuild project and it found a reference.
I've tried every solutions, but the problem was that Android Studio had compiled, with any apparent reason, in a different build type of the module that contains the AIDL packages than it was specified by the settings.
From debug to release, so the other modules couldn't see the AIDL pkg.
Switching from debug to release and turns back, solved my problem.
restarting Android Studio worked for me
a second silly thing that took me a while. I dropped the code on Android Studio to allow him create the file, but he created a .java (as expected) instead a .aidl Jiji, stupid of me
if you do all the names correct go to Build>rebuild project
it worked for me
I use Android Studio 4.1, just right click mouse -> New -> AIDL -> AIDL File.
A file will be created and placed in the [src/main/aidl] folder automatically. The aidl folder will also be created if it does not exist.
This function only supports min sdk 16+. My old project still can be supported, you can temporarily modify the min sdk to 16, create aidl and build project. After the relative interface and class be generated, recover the min sdk settings, it also works and builds project well then.
My friend created an android application using phonegap, jquery and facebook sdk in eclipse. I wanted to run the application in my computer. So I imported the whole project into eclipse. I downloaded all the necessary APIs. Initially I got a lot of errors, but I solved most of them.
Now I am stuck with just one error. And it is in the src/com.facebook.android./FbDialog.java file. One particular line
Drawable crossDrawable = getContext().getResources().getDrawable(R.drawable.close);
gives the error R cannot be resolved to a variable.
I have gone through a lot of similar questions on this website as well as other websites. I have cleaned the project innumerable times. The R.java file builds successfully. Also, my friend is not getting any error when he runs the same project in his laptop. So I don't think there is any problem with the coding part.
I am definitely missing some important setting or download. Please help. This one error is giving me a lot of headaches.
I am a new user her so cant upload a screenshot.
1st. res/drawable folders (ldpi, mdpi, hdpi) must contain an image named close, if not add it. I doesn't really mater, in order to overcome the error, in which of them the file exist.
But in order to use resourses properly see the Android documentation here
2nd. File FbDialog.java must have an import of the R.java sometimes the R imports get mixed with clean & built and instead of import your.package.com.R; it is included the import android.R;
Depending on the dependency libraries or related projects of main project the close file resource may be a part of an other library in that case you will need import that.package.com.R;. So if it is part of Facebook SDK then you will need import com.facebook.android.R;
I hope you get the logic of how R imports work.
Update: Lets force it to work, change line to:
Drawable crossDrawable = getContext().getResources().getDrawable(your.package.com.R.drawable.close);
i have an android project which has a lot of classes I've built.
i want to organize it to sub folders and my package in eclipse.
when i'm adding a folder and move files over there, what changes should i do in the code so the file which need this classes can reference to it?
is it something in the:
import android.app_name.folder_name.class_name
help will be appreciated, my project is beginning to be a big mass..
if its not possible i will be glad to hear about other solution
Eclipse has a rename/refactor method you can use. The only issue I'm familiar with is the fact that it seems to break the manifest.xml
Yes you can import project into Eclipse...
Then you should create a Package to manage related classes. (FYI, package is ultimately creates folder hierarchy on your drive).
Note: Make sure you provide a correct reference of the particular class in AndroidManifest.xml file.