android annotation after checkout from svn - android-annotations

i set up the project using android annotation, then check in to the svn after the checkout from the SVN ,the problem started ,please do something if anybody experienced in this
08-14 13:02:31.097: W/dalvikvm(16362): threadid=1: thread exiting with uncaught exception (group=0x41948ba8)
08-14 13:02:31.097: W/System.err(16362): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{}: java.lang.ClassNotFoundException: Didn't find class "com.MainActivity" on path: DexPathList[[zip file "/data/app/"],nativeLibraryDirectories=[/data/app-lib/com-2, /vendor/lib, /system/lib]]
08-14 13:02:31.097: W/System.err(16362): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
08-14 13:02:31.097: W/System.err(16362): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
08-14 13:02:31.097: W/System.err(16362): at android.app.ActivityThread.access$800(ActivityThread.java:135)
08-14 13:02:31.097: W/System.err(16362): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
08-14 13:02:31.097: W/System.err(16362): at android.os.Handler.dispatchMessage(Handler.java:102)
08-14 13:02:31.097: W/System.err(16362): at android.os.Looper.loop(Looper.java:136)
08-14 13:02:31.097: W/System.err(16362): at android.app.ActivityThread.main(ActivityThread.java:5001)
08-14 13:02:31.097: W/System.err(16362): at java.lang.reflect.Method.invokeNative(Native Method)
08-14 13:02:31.097: W/System.err(16362): at java.lang.reflect.Method.invoke(Method.java:515)
08-14 13:02:31.097: W/System.err(16362): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
08-14 13:02:31.097: W/System.err(16362): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
08-14 13:02:31.097: W/System.err(16362): at dalvik.system.NativeStart.main(Native Method)
08-14 13:02:31.107: W/System.err(16362): Caused by: java.lang.ClassNotFoundException: Didn't find class ".MainActivity_" on path: DexPathList[[zip file "/data/app/com.-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.-2, /vendor/lib, /system/lib]]
08-14 13:02:31.107: W/System.err(16362): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
08-14 13:02:31.107: W/System.err(16362): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
08-14 13:02:31.107: W/System.err(16362): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
08-14 13:02:31.107: W/System.err(16362): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
08-14 13:02:31.107: W/System.err(16362): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
08-14 13:02:31.107: W/System.err(16362): ... 11 more

latter i found this answer
->Right click the project
->select Property
->select Java Compiler
->select Annotation processing
->Select Factory Path
there remove the jar file and re add the jar file, the do Apply, then give OK

Related

Application crushed : terminating with uncaught exception of type NSException

I'm programming an application in Swift and Objective-C and when I run the test app on the iPhone everything works, but when i was trying to start a call the application crashed showing this:
*** First throw call stack:
(0x181be11b8 0x18061855c 0x181be1100 0x182610eb8 0x100265a2c 0x187acbd30 0x187acbcb0 0x187ab6128 0x187acb59c 0x187acb0c4 0x187ac6328 0x187a96da0 0x18828075c 0x18827a130 0x181b8eb5c 0x181b8e4a4 0x181b8c0a4 0x181aba2b8 0x18356e198 0x187b017fc 0x187afc534 0x1002bc898 0x180a9d5b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) terminating
This is the button code:
- (IBAction)startCallButton:(id)sender {
TCallViewController *callViewController = [[TCallViewController alloc] init];
[self.navigationController pushViewController:callViewController animated:YES];
NSString *handle = [[NSString alloc] initWithString:_handle];
BOOL Video = _video;
if ((handle = callViewController.handle) ){
Video = callViewController.video;
[callManager startCallWithHandle:(handle) video:Video];
}
}
how can I solve this problem?

Unrecognized selector - save to Core Data

Help please to solve the problem - I do not understand why there is an error - unrecognized selector send to instance.
The error occurs when this code in AppDelegate is executed:
TMMonth *m = [NSEntityDescription insertNewObjectForEntityForName:#"TMMonth" inManagedObjectContext:self.managedObjectContext];
m.paymentMonth=#"month";
[self.managedObjectContext save:nil];
reason: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TMMonth name]: unrecognized selector sent to instance 0x7f993bdbbb00'
But in my code there is no selector 'name' in TMMonth class.
https://github.com/maks-84/paymentApp.git
error occurs when execute code in AppDelegate
TMMonth *m = [NSEntityDescription insertNewObjectForEntityForName:#"TMMonth" inManagedObjectContext:self.managedObjectContext];
m.paymentMonth=#"month";
[self.managedObjectContext save:nil];
reason: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TMMonth name]: unrecognized selector sent to instance 0x7f993bdbbb00'
But in my code no selector 'name' in TMMonth class

How to display date & time on alert box

I am facing error , when alert box clicked. Error is incompatible array pointer with String .
2015-10-14 12:41:06.235 snadwitch2[1974:56154] -[__NSArrayI length]: unrecognized selector sent to instance 0x7f954e918e60
2015-10-14 12:41:06.239 snadwitch2[1974:56154] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0x7f954e918e60'
The alert box code is
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Wait" message:# [#"The current date and time is: %#", [NSDate date]] delegate:self cancelButtonTitle:#"Delete" otherButtonTitles:#"Cancel",nil];
[alert show];
You are passing an array instead of a string. You need:
NSString *message = [NSString stringWithFormat:#"The current date and time is: %#", [NSDate date]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Wait"
message:message
delegate:self
cancelButtonTitle:#"Delete"
otherButtonTitles:#"Cancel",nil];
[alert show];

how do i execute tcpdump on iphone?

I could successfully run the following command on simulator
tcpdump -i en0 -A -vvv host www.facebook.com
I used the following code
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath: #"/usr/sbin/tcpdump"];
[task setArguments: [[NSArray alloc] initWithObjects:#"-c",#"10", #"-i",#"en1",#"-A",#"-vvv",#"host",#"www.facebook.com", nil]];
NSPipe *pipe= [NSPipe pipe];
[task setStandardOutput: pipe];
file = [pipe fileHandleForReading];
[task launch];
when i run this code on iPhone it gives following error
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible'
* First throw call stack:
(0x2f4a5f4b 0x398e66af 0x2f4a5e8d 0x2fe93081 0x12933 0x31c1d37b 0x31c1d139 0x31c23e05 0x31c214db 0x31c8c08d 0x31c88e59 0x31c83353 0x31c1e41f 0x31c1d721 0x31c82b3d 0x3410170d 0x341012f7 0x2f4709df 0x2f47097b 0x2f46f14f 0x2f3d9c27 0x2f3d9a0b 0x31c81dd9 0x31c7d049 0x12f2d 0x39deeab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
i have tried removing "/usr/sbin/" from code when running on iphone still it gives same error.Where am i going wrong?

iOS-Using upload image on Google Drive Api(error "Assertion failure in: GTLServer...")

I'm trying to use Google Drive in my iOS app. I try to upload a file, I get the following error:
2013-06-17 14:38:57.964 GTL Demo[6495:11303] *** Assertion failure in -[GTLService uploadFetcherWithRequest:fetcherService:params:](), /Users/huylx612/demo2/google-api-objectivec-client-read-only/Source/Objects/GTLService.m:565
2013-06-17 14:38:58.049 GTL Demo[6495:11303] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'GTMHTTPUploadFetcher needed'
*** First throw call stack:
(0x1e01012 0x1307e7e 0x1e00e78 0xd9d6d0 0x3d0ba 0x3cb55 0x3de06 0x42a89 0x3642 0x2ee4 0x44ee3e 0xed7ed11 0xed772fd 0xedfa9f8 0x131b6b0 0xd47765 0x1d84f3f 0x1d8496f 0x1da7734 0x1da6f44 0x1da6e1b 0x21947e3 0x2194668 0x24bffc 0x26bd 0x25e5)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Here's my relevant code:
- (void)uploadPhoto:(UIImage*)image
{
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:#"'Quickstart Uploaded File ('EEEE MMMM d, YYYY h:mm a, zzz')"];
GTLDriveFile *file = [GTLDriveFile object];
file.title = [dateFormat stringFromDate:[NSDate date]];
file.descriptionProperty = #"Uploaded from the Google Drive iOS Quickstart";
file.mimeType = #"image/png";
NSData *data = UIImagePNGRepresentation((UIImage *)image);
GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:data MIMEType:file.mimeType];
GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:file
uploadParameters:uploadParameters];
UIAlertView *waitIndicator = [self showWaitIndicator:#"Uploading to Google Drive"];
[self.driveService executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,GTLDriveFile *insertedFile, NSError *error)
{
[waitIndicator dismissWithClickedButtonIndex:0 animated:YES];
if (error == nil)
{
NSLog(#"File ID: %#", insertedFile.identifier);
[self showAlert:#"Google Drive" message:#"File saved!"];
}
else
{
NSLog(#"An error occurred: %#", error);
[self showAlert:#"Google Drive" message:#"Sorry, an error occurred!"];
}
}];
}
Help me!
GTMHTTPUploadFetcher is not linked, please add -ObjC -all_load to the Other Linker Flag options.

Resources