Hi I have a problem with the ActionBarSherlock after importing.
I made the following steps:
I Imported the stuff from the library folder
I checked if the project is set as IsLibrary
I selected Project Build target: Android 4.0
then the project look like this:
I dont know whats wrong, the error in the first package e.g. is:
The method onCreatePanelMenu(int, Menu) of type Watson must override a superclass method
ActionBarSherlock library is full of errors after being imported
There May be other ways, My Suggestion is to go to java file and remove all #override symbols above the methods there, because I have also faced that problem and I did that to get rid of those errors! I think this may meet your need.
Related
I am trying to import GSON into my project using gradle in android studio. I have used instructions found on google'sGitHub and several stack overflow pages, such as here. However when I go to import into my file using the line
import com.google.gson.Gson;
I still get the following error
Error:(5, 23) error: package com.google.gson does not exist
example from my app's build.gradle
compile 'com.google.code.gson:gson:2.7'
and my settings.gradle
include 'gson:2.7'
Am I missing something?
Open your project. Go to File -> Project Structure...
Click on app in the Modules section and switch to the Dependencies tab. Click on the plus icon in the top right corner and select Library dependency. Select the entry for the GSON library from the list and hit OK twice. (Note: the search bar didn't work for me)
Then you are able to use the library just like you described in your question:
import com.google.gson.Gson;
Note that after adding the library your project will do a gradle sync which may take a couple of minutes.
The dependency should be imported properly after syncing your project.
Try selecting Sync Project with Gradle Files in the upper right corner of Android Studio (referring to the default layout of Bumblebee).
I'm trying to integrate Google Calendar API into my android project and I follow the tutorial here
https://developers.google.com/google-apps/calendar/quickstart/android
At step 5 create a new java class
I right click project folder src>main>java>com>example>utarapp and then new>file and entered the file name but then it has this error
What's going on ?
I'm using android studio 1.3.1
I think you are trying to create file with same name which is already present in the same package. This may be one possible reason.
It seems like you are right-clicking on the upper level in your application's directory tree.
Right click on one of the files inside the utarapp folder and then select Java class option from the menu.
For me this was happenning because of the length of the class name. In my case it was "ChallengesFragmentPagerAdapter"!
Changing it to "ChallengesPagerAdapter" solved the problem.
Create a blank Activity then remove "extends Activity" from the activity class.
(Noob alert!)
I want to add an SQLite component to a simple (one Java source file) app and would like to put it in a separate file. I was hoping to find something that would let me click a couple check boxes and creae the file using a template with the standard overrides and class declarations (e.g. ... MyClass extends SQLiteOpenHelper {...} and so on. Instead I can't even figure out how to add an empty .java file to the project. Google's Android Studio Tips 'n Tricks suggest navigating to the 'appropriate directory in the Project pane' and hit N. That gets me a dialogue that rejects my class name and seems to open a header file if I enter the name if the class I wish to extend (and without apparently adding anything to my project.)
I do not even see a way to add an existing file to the project. OK... I now see that if I create the .java file in the app directory (along side the MainActivity.java file) that Android Studio automatically includes it.
Is this Standard Operating Procedure? It leaves me feeling like I'm not leveraging the capabilities that Android Studio provides.
I'm using AS 0.5.2, openJDK 1.7.0
Thanks!`
If you're creating a new Java class from the Project pane, you don't need to add the ".java" to the name; you're specifying the name of the Java class, not the source file. It will figure out the filename automatically.
Just getting started with xamarin studio and iOS development... I'm trying to set up my development projects. When setting all this up, I had initially created a project called 'MyProject.iOS'. I later decided that I didn't want the 'p' in MyProject to be capitalized. I deleted the existing project (using finder), removed it from my existing solution, and created a new one named 'Myproject.iOS'.
Now, when I try to open the Myproject_iOSViewController.xib file to edit in xCode, I get the following error:
Error updating Objective-C type information. Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
Seems like something is stuck in xCode from my original project that had the same name w/ different casing. I looked in Finder and confirmed that all the old files are gone.
I believe I am experiencing the same issue that was reported here (not sure why this issue is marked as resolved): https://bugzilla.xamarin.com/show_bug.cgi?id=7550
The last commenter has a great repo and reports this solution that worked for him:
1. Close XS
2. Delete ~/Library/Caches/XamarinStudio-4.0 folder
3. Open XS : voilĂ everything works again now !
My issue at this point is that I cannot find the ~/Library/Caches/XamarinStudio-4.0 to delete. I found a ~Library/Caches/ folder but it did not have a XamarinStudio-4.0 sub-folder in there. How can I resolve this?
I am using 4.0.9 (Build 12) of Xamarin studio.
Here is the full stack trace from the error message box that shows up when I double click the xib file:
System.ArgumentException: Multiple types (MyProject.iOS.AppDelegate and Myproject.iOS.AppDelegate) registered with the same Objective-C name: AppDelegate
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update () [0x00118] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:98
at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update (Boolean force) [0x0000c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:72
at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateTypes (IProgressMonitor monitor) [0x0003c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.9-branch/f9c5c24e/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:476
I just had this problem. I used that post to solve it. At first I could not find the folder that is referenced. This is how I found it.
Go into finder on the Mac.
Under Favorites on the left of the screen, select the primary volume. For me that was labeled Macintosh HD.
Select Go/Go to Folder from the toolbar.
In the Go to the Folder screen that pops up type in ~/Library.
From there you can navigate to the proper directory and delete it.
Hope that helps. Best of luck.
I am new to Android. Well the problem I am facing is that I have two layouts. One is main.xml and another that I made was relative_layout.xml.
I did not give it an #+id/ to this layout so the default id was relative_layout01.xml but when I gave this an id the old one still remain in my R.java and when I edit R.java it again generated the old version of file.
I want to delete relative_layout01.xml reference as it does not exists as I have given a name to my layout.
Attaching an image for reference.
R.java should be refreshed automatically.
Maybe you still have some references to it in your code (setContentView(R.relative...) or you still have it as an activity in AndroidManifest.xml?
Sorry for the noobish answer. Just my 2 cents..
Delete import android.R, and R.java completely, rebuild and it would be fine