Error on SIMPLE ANDROID OCR - android

When I tried the Simple Android OCR (https://github.com/GautamGupta/Simple-Android-OCR) in ANDROID STUDIO it gave me a runtime error as shown in the picture. Can anyone help me with this?
![Runtime error occured when tried to run][2]
06-03 12:44:31.904 17051-17051/com.startup.vrvijay.liccamera E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.startup.vrvijay.liccamera, PID: 17051
android.util.SuperNotCalledException: Activity {com.startup.vrvijay.liccamera/com.startup.vrvijay.liccamera.MainActivity} did not call through to super.onCreate()
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2333)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
at dalvik.system.NativeStart.main(Native Method)

You forgot to place:
super.onCreate(savedInstanceState);
right after your
protected void onCreate(Bundle savedInstanceState) {

Related

Greendao and NoClassDefFoundError

In the process of using greendao, when the initialization time, being given:
java.lang.NoClassDefFoundError: org.greenrobot.greendao.query.WhereCollector
This exception did not occur during the compilation process, and the actual error code crashed directly at run time as follows:
AndroidRuntime: FATAL EXCEPTION: main
Process: com.luckytry.hybrid.mainapplication, PID: 4274
java.lang.NoClassDefFoundError: org.greenrobot.greendao.query.WhereCollector
at org.greenrobot.greendao.query.QueryBuilder.<init>(QueryBuilder.java:85)
at org.greenrobot.greendao.query.QueryBuilder.<init>(QueryBuilder.java:77)
at org.greenrobot.greendao.query.QueryBuilder.internalCreate(QueryBuilder.java:73)
at org.greenrobot.greendao.AbstractDao.queryBuilder(AbstractDao.java:793)
at com.luckytry.luckylibrary.MyAplication.APPAplication.initData(APPAplication.java:132)
at com.luckytry.luckylibrary.MyAplication.APPAplication.initDB(APPAplication.java:117)
at com.luckytry.luckylibrary.MyAplication.APPAplication.onCreate(APPAplication.java:39)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1009)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4655)
at android.app.ActivityThread.access$1800(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1322)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
at dalvik.system.NativeStart.main(Native Method)
Try this:
-Add this dependency compile 'com.android.support:multidex:1.0.1'
-Add multiDexEnabled = true in your build.gradle app config.
-Change your extend Application "MyAplication.APPAplication" to MultiDexApplication.

Firebase Cloud Messaging -> Illegal State Exception in Android

I am trying to make an app based on Cordova that is able to send Notifications via FireBase Cloud Messaging
Here the MainActivity.java
public class MainActivity extends CordovaActivity
{
#Override
public void onCreate(Bundle savedInstanceState)
{
Intent i=new Intent(this,NotificationService.class);
startService(i);
super.onCreate(savedInstanceState);
// Set by <content src="index.html" /> in config.xml
Helper mhelper=new Helper(this,appView);
FirebaseMessaging.getInstance().subscribeToTopic("Testing");
Log.d("Message","Subscribed To Testing");
Log.d("Token",FirebaseInstanceId.getInstance().getToken());
loadUrl(launchUrl);
}
}
However I am getting a Illegal State Exception at Line 49:
FirebaseMessaging.getInstance().subscribeToTopic("Testing");
The rest Manifest.xml etc. are the same as the sample provided here
https://github.com/firebase/quickstart-android/tree/master/messaging
In the Logcat, the error it is showing is::
FATAL EXCEPTION: main
Process: careerage.jobseeker.app, PID: 5764
java.lang.RuntimeException: Unable to start activity ComponentInfo{careerage.jobseeker.app/careerage.jobseeker.app.MainActivity}: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3738)
at android.app.ActivityThread.access$900(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at com.google.firebase.messaging.FirebaseMessaging.getInstance(Unknown Source)
at careerage.jobseeker.app.MainActivity$override.onCreate(MainActivity.java:49)
at careerage.jobseeker.app.MainActivity$override.access$dispatch(MainActivity.java)
at careerage.jobseeker.app.MainActivity.onCreate(MainActivity.java:0)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3738) 
at android.app.ActivityThread.access$900(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
I tried java.lang.IllegalStateException: FirebaseApp with name [DEFAULT]
but still it doesn't recognize FirebaseDatabase Class
Try updating your dependency to:
compile 'com.google.firebase:firebase-messaging:9.0.2'
This bug was fixed in patches between 9.0.0 and 9.0.2
I think Fcm and Gcm take some time to get tokens.. If you try to do anything with cloud messaging without the token being assigned you will get error.

Cocos2d-x v3.7.1 Unfortunately, libcocos2dx has stopped

I'm compiling a new project through proj.android-studio using:
cocos compile -p android --android-studio
But when I start app on android device, it shows me a message:
Unfortunately, libcocos2dx has stopped
Can you help me? What I'm doing wrong?
Here is logcat:
09-07 12:07:47.711 23074-23074/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: org.cocos2dx.TestGame, PID: 23074
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "srand" referenced by "libcocos2dcpp.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:553)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:288)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:303)
at android.app.Activity.performCreate(Activity.java:5343)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5341)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Usually the app stops working if your code contains errors.
Are there errors in your code? What does the LogCat say?

Apache Log4j in Android gives exception java.lang.VerifyError: org/apache/log4j/config/PropertySetter

I am trying to integrate Flickr in android using the Flickr4Java library. Flickr4Java uses Log4j for logging. So when I try to create an instance of flickr, something like Flickr flickr = new Flickr(apiKey, sharedSecret, new REST()); I get the following stack trace
05-12 01:24:28.714 8449-8449/edu.sdsu.cs.sharepic E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: edu.sdsu.cs.sharepic, PID: 8449
java.lang.VerifyError: org/apache/log4j/config/PropertySetter
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:805)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
at org.apache.log4j.Logger.getLogger(Logger.java:117)
at com.flickr4java.flickr.REST.<clinit>(REST.java:46)
at edu.sdsu.cs.sharepic.model.Flickr1.<init>(Flickr1.java:28)
at edu.sdsu.cs.sharepic.activity.SelectProfileActivity.init(SelectProfileActivity.java:75)
at edu.sdsu.cs.sharepic.activity.SelectProfileActivity.onCreate(SelectProfileActivity.java:41)
at android.app.Activity.performCreate(Activity.java:5248)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
I am guessing it has got something to do with configuration of the log4j library, but don't know how to solve the problem. Any help will be much appreciated.
Log4j uses apis from java.beans that is missing in android.
Try this library https://code.google.com/archive/p/android-logging-log4j/
I have yet to look at it tough

Getting uknown error when using mupdf

I've tried to import mupdf to my app, but when I open it, i got some weird error and it force closes. Why? I really don't understand.
this is my logcat:
10-10 15:34:17.802 8657-8657/com.tproductions.Openit E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.tproductions.Openit, PID: 8657
java.lang.UnsatisfiedLinkError: Native method not found: com.artifex.mupdfdemo.MuPDFCore.openFile:(Ljava/lang/String;)J
at com.artifex.mupdfdemo.MuPDFCore.openFile(Native Method)
at com.artifex.mupdfdemo.MuPDFCore.<init>(MuPDFCore.java:68)
at com.artifex.mupdfdemo.MuPDFActivity.openFile(MuPDFActivity.java:204)
at com.artifex.mupdfdemo.MuPDFActivity.onCreate(MuPDFActivity.java:303)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2201)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:212)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
at dalvik.system.NativeStart.main(Native Method)
It looks like something has gone wrong in the native build.
It's probably best to retry that; there are instructions here:
http://www.mupdf.com/doc/how-to-build-mupdf-for-android
and here:
http://git.ghostscript.com/?p=mupdf.git;a=blob_plain;f=platform/android/ReadMe.txt;hb=HEAD
It's probably best to use the git code from master - the latest is 1.6, versions prior to 1.5 are unlikely to build cleanly with the current NDKs.

Categories

Resources