Eclipse cannot import jtwitter-yamba.jar in learning android - android

Im using Eclipse Juno and ADT 20 v2 My Yamba app which has no errors forces close immediately it is launched
My Logcat shows me in the Yamba app
Could not find class "winterwell.jTwitter.Twitter" referenced from method com.marakana.yamba.StatusActivity.onCreate
I know many people here used Yamba to learn Android programming and d Oriellys site has no solutions
Is it the "Twitter("student","password") API root.." That is causing this?

I was able to solve this error by doing the following in Eclipse:
Project -> Properties -> Java Build Path -> Order and Export
then select "[x]jtwitter-yamba.jar - /path/to/jar"
Before it worked though, I had to do:
Project -> Clean...
Then ctrl-F11 to rebuild

Try using the latest version of normal JTwitter. I think it's compatible with Yamba. You need to call Twitter.setAPIRootUrl() to point it at Yamba instead of Twitter.

Related

Could not find BaseGameUtils.apk

For the last 2 days I've been trying to simply get Google play game services Integrated into my game. I've followed the instructions here...
https://github.com/playgameservices/android-basic-samples/blob/master/README.md
...many many times. I have been trying to get it to build with Gradle but for now, I'll just focus on Eclipse building until that works. I've imported BaseGameUtils project into my workspace as an Android library project. My game android project has two Android library dependencies: google-play-services_lib and BaseGameUtils. Everything in Eclipse is showing without any errors. When I build and run on a real device, I see an error that says -
[2014-10-27 20:39:25 - BaseGameUtils] Could not find BaseGameUtils.apk!
I don't know why it's even looking for BaseGameUtils.apk since it should be an Android library. That said, I'm not sure how an Android library is really handled so maybe it should be a .apk. In any case, I couldn't find any information on this bug and the error message doesn't give me much to work with. I've tried adjusting things in the Build Path but no luck. I did have to remove some redundant dependencies in my Build Path earlier since I was getting some kind of duplicate DEX error but I'm not sure that's related in any way to this. I am desperate for help, anyone have any idea?
Can you try this? It has to do with conflicting methods of specifying that a project is a library.
I found the source of the problem!
It turns out that "with the new library feature, you don't specify the
Android projects you depend on in the Java Build Path section of the
Properties. You do it in the Android section of the Properties".
So all I had to do is go the Application Project's Properties, hit the
Projects tab, select my own library project and click the Remove
button. That's it. No more problem.
In Eclipse Java EE select the project Properties, then select Project
References, then check the FacebookSDK (see screen capture)
From: Android Eclipse - Could not find *.apk
If that doesn't help, you may want to double check that you selected "Is Library" in BaseGameUtils.
Also, when you hit "Run" in Eclipse, are you running your application and not BaseGameUtils?
Please would you check that BaseGameUtils has "is library" checked and that your application project DOES NOT have "is library" checked.
If this is correct, then please would you review the following in detail (especially as regards checking and unchecking "is library" ) :
Android Eclipse - Could not find *.apk
I presume that the DEX error related to two or more versions of the same lib. What is the specific GameHelper error ?
As a general point, I find it productive to get a sample project working first to ensure that I have got the environment working correctly before I start integrating game services into my own projects. If you have been changing the build path then it may be quicker to start from scratch and get a sample working. I have followed those instructions in the past and they are accurate.

NoClassDefFound Error in android after updating the SDK

I was using ADT with Eclipse 22.3 version where my code was working fine but as soon as I started using the latest version 22.6 (to implement few functions which could not be done in 22.3) i got this error. I tried out stuff like restart eclipse,clean project,build pathh also created libs folder and copied all jars in it.The class for which i am getting this error is a third party (AmazonS3Client).I have included all jars correctly checked them in referenced libraries.It was working well in earlier version but not here.please someone help
Go to Project -> Properties -> Java Build Path -> Order & Export and ensure Android Private Libraries are checked for your project and for all other library projects you are using. Clean all projects and run it.
You need to go to Go to Project->Properties and make some changes as per the answer.
Check the answer here

unable to instantiate application - ClassNotFoundException

EDIT: This problem has not already been resolved in the other suggested SO question
I had a fully working app on the market for over a year, with very few crash reports. Then recently I changed my app into a library, so that it could be included within multiple different "wrapper" projects. This was so that I could easily make different version - free, paid, non-google markets, with/without in-app purchasing etc etc.
The new "library+wrapper" app appeared to work fine. I could run it multiple times, without error. But then a day later (when presumably the OS had closed some or all of the app's activities) I tried to run it and it reported
Unable to instantiate application com.mycompany.mygamelibrary.MyGameApplicationClass: java.lang.ClassNotFoundException: com.mycompany.mygamelibrary.MyGameApplicationClass
The class it failed to find is the first class that runs when the program starts up, MyGameApplicationClass - which extends Application. This class is part of the library.
I suspect something goofy in one of the two manifest files.
The manifest of the wrapper project contains the lines...
<application android:icon="#drawable/mygame_icon"
android:screenOrientation="portrait" android:label="My Game Name"
android:name="com.mycompany.mygamelibrary.MyGameApplicationClass">
Any ideas what could have gone wrong?
EDIT: The library was referenced "the correct way" as defined by yorkw's answer to this SO question.
EDIT: I can not repeat the crash at the moment :-( I don't know what it is the OS does when the app is not used for a day or two.
There are two possibilities. Either you, like me, have a spelling error in your manifest file. Have a co-worker or friend read it to make sure the name is correct. Or you have not referenced the project correctly.
The official document describes how to properly link projects in its documentation.
Why it would first seem to work and later stop working is a bit of a mystery. However, I guess that the VM might still have had the necessary references ready to resolve the classes in the library just fine. A restart of the VM removed all those references and trying to resolve them was unsuccessful.
Update: Regarding the edits in the OP: As you confirm that you have correctly referenced the other project, you can check if the project is included in APK, just to be sure. You can rename and open an APK as any other archive (.rar works fine for me). Sometimes, it happened to me, the project is not correctly included in the APK. A cleaning of your workspace usually remedies the problem and so could a restart of your IDE depending on what you are using. To manually conduct a clean in Eclipse for example, use Project->Clean... or try Android Tools->Fix Project Properties by right-clicking on your project.
As you seem to also have fixed the problem by restarting your device, it could be that the libraries were linked incorrectly. A problem that I have never seen myself but as a very common quote says: "Have you tried turning it off and on again?".
For Android Studio:
Build --> Clean Project
Fixed issue.
Have you tried to make a new subclass of MyGameApplicationClass in your 'main' project and set it in the manifest as Application class?
I had a slew of bugs with Android Studio 3.0 Canary 4 and the way I fixed them was by editing the AndroidManifest.xml by adding in some jibberish to the application name. Then, I clicked build. Obviously, a whole mess of new error messages appeared. I changed the name back to what it should be, built the app, and it just ran.
Sometimes, I just don't know...
EDIT: Just ran into this issue on Android Studio 3.0 Canary 4 on my laptop when switching over. I again went through the same process of changing AndroidManifest.xml file to contain a typo, building, and changing back. That didn't work.
I then noticed that instant run was still enabled. Going into settings (by clicking command + , (comma key)) and typing "instant run", I was able to disable instant run, built the app, and the error of class not found went away.
Summary of Steps to Fix [FOR ME]
Invalidate cache / restart
Clean the project
Manually delete the build folder (need to be in project view for this one)
Make an intentionally errant edit to your AndroidManifest.xml file, build the app, observe the errors, remove the errant edit and build again
Disable instant run
Again, I don't mean to insinuate that this will fix everyone's error, but I have now used some combination of these steps on two different machines (MacOS Sierra) and it has been resolved for me. Hope it helps.
In my case, application id and package were mismatched. This should be same as presented in following images...
AndroidManifest.xml
app/build.gradle
In this case you can see, applicationId and package both are same that is com.mycompany.mygamelibrary
May be its a Build Path Configuration problem.I did the following to solve the issue.
1.Right click on your project and go to Java Build Path.
2.Click on Order and Export tab.
3.Check Android Private Libraries and other 3rd part libraries if you have added.
4.Press ok and clean the project.
I hope it will solve the issue.
Once I had the same error message, but maybe the cause isn't the same.
I did a code and worked for a while, then I wanted to improve it and got the same error and I couldn't run it.
I could fix the problem with
the correct Build Path order (as I can see you've already did this)
I check on the Order and Export tab the android-suppor-v4.jar
and the key was the Android SDK Managert->Upgrade everything and (next) Eclipse->Help->Check for updates.
After I upgraded to the latest android plugin and SDK my app compiled and ran again.
I hope this will help you!
I'm not very sure about this but it might be that your system's debug.keystore license validity has expired as it is valid for only 365 days. You just need to delete the debug.keystore from your computer. The debug.keystore will be generated automatically by Eclipse when you compile your Android App.
Same message seen ... this time it turned out to be different output folders for MyApp/gen and MyApp/src in the Build Path (caused by Maven integration).
Unchecking "Allow output folders for source folders" solved the problem.
I had this issue in an Android application that needed an Application class which was created in wrong path inside the Android Studio project. When I moved the class file to the correct package, it was fixed.
This all Process work for me to solve application class Exception.
Step 1: Open Run(window+R) Search -> Prefetch Remove all file (Some file not Delete)
Step 2: Open Run(window+R) Search -> %temp% Remove all file (Some File not Delete)
Step 3: Open Android Studio -> Build -> Clean Project
OR
Select File > Invalidate Caches / Restart > Invalidate and Restart from Android Studio toolbar.
OR
Close and reopen Android project.
OR
Restart System
I ran into this issue several times and both times it seemed to be caused by some instant run feature.
In my case, deleting the application from the device and then installing it from Android Studio again resolved the issue.
I ran into this problem today. The project runs well for over a year but today it reports this issue, and cannot debug on my testing device.
I fixed it by updating to latest gradle version. Hope this can solve your problem.

Unresolved GWT error in LibGDX HTML project

I followed the tutorial here but when I go to 'Problems" tab in order to make Quick Fix it says:
The type com.google.gwt.core.client.EntryPoint cannot be resolved. It
is indirectly referenced from required .class files
If I do 'Quick Fix' it appears the following :
and if I press finish it goes to :
I have also installed the pluging from here.
So , I don't know what to do.
I used Properties->Jav Build Path->add Library and I got:
But if I choose Plugin Dependancies it's empty.
If I use User Libraries I don't know what to do.
OK, the problem was that I installed only 'GWT Designer' and 'Google Plugin for Eclipse'.
You have to install also 'SDKs'.
Now it works fine and it doesn't have an error at all.
I got the same problem and solved it by going in Preferences > Google > Web Toolkit then remove the GWT SDK path that showing an error (probably pointing to the wrong folder) and check the one that is shown as working and it should be ok.

Unable to load Facebook SDK to Eclipse. Build Path Error

So I have not been able to even start coding for the app I want to build, I am having a really hard time getting the SDK set up for me to code based on it.
Here is what I did:
Downloaded Eclipse
Downloaded the JDK, Android SDK, and ADT on Eclipse.
Created a directory named "Facebook", where I cloned: https: //github.com/facebook/facebook-android-sdk .git (Separated to avoid the spam mechanisim :P)
Created a new project from existing source; please note that on the tutorials it reads "Create project from existing source" as an option within the "New Android Project" workflow, but my Eclipse only has "Android Project From Existing Code" (see: http://db.tt/gOmutx08 and that is what I used) as a separate workflow. Also, there is no "New Android Project" here, only a new "Android Application Project" and this does not prompt me to select an existing project as source (see: http://db.tt/usuzcTxS ). Not sure if this is where the problem is coming from.
Created a new project, and added the SDK project we created previously as a reference library.
The problem must definitely be on step number 4 as I get the following errors on my Eclipse Problems logger:
a) Description Resource Path Location Type
The container 'Android Dependencies' references non existing library 'F:\Users\Desktop_1\Android\Facebook SDK\facebook-android-sdk\facebook\bin\facebook.jar' Test-Facebook Build path Build Path Problem
b) Description Resource Path Location Type
The method onClick(View) of type new View.OnClickListener(){} must override a superclass method FbDialog.java /facebook/src/com/facebook/android line 101 Java Problem
c) Description Resource Path Location Type
The method onServiceConnected(ComponentName, IBinder) of type Facebook.TokenRefreshServiceConnection must override a superclass method Facebook.java /facebook/src/com/facebook/android line 575 Java Problem
d) Description Resource Path Location Type
The method onServiceDisconnected(ComponentName) of type Facebook.TokenRefreshServiceConnection must override a superclass method Facebook.java /facebook/src/com/facebook/android line 581 Java Problem
e) Description Resource Path Location Type
The project cannot be built until build path errors are resolved Test-Facebook Unknown Java Problem
Where the main problems are a and e, as the project cannot be built if there is an issue with the build path. Problems b through d can easily be fixed by removing the "#override" annotation from all three lines; however, I am not sure this is the actual fix because the SDK should have no issues in the first place, and removing the annotation may not make it work in the end.
Any ideas as to what I could try? I have already deleted the whole SDK download, and recloned the repository several times, even on different folders. Not sure anymore, and I am not sure why the screenshot from the tutorial looks way different than my eclipse. My guess is that the tutorial is slightly outdated as it still uses Froyo as a target :P
Any help is appreciated.
I had faced most issues you faced. I had it resolved.
Eclipse for some reason chose to keep facebook project is Java 1.5 eventhough my eclipse preferences had the setting to use Java compiler 1.6.
So, go to Project Properties in facebook project and select the java compiler to be 1.6. This solved my problem. Hope it solves yours too.
I've repeated Your steps and found out the following:
Seems Yours facebook project is not library one. Please, ensure that under facebook project Android properties 'Is Library' is checked (this should remove a and e errors);
Create project from existing source == Android Project From Existing Code
I think you have downloaded newer version of Android SDK - API Level 16 - Jelly Bean..
Before API level 16 , we had an option for Create project fron existing source , now it has been changed.
So if you wanna use Project from particular location you can use Android Project From Existing Code..
Also after creating Project make facebook source as library project...

Categories

Resources