Android - GreenDroid and googleapis - android

I have used GreenDroid library in my application. There is no error on compilation (building). When I run this application on emulator it shows this error in console as
[2013-02-13 18:10:08 - GreenDroid] Could not find GreenDroid.apk!
[2013-02-13 18:10:08 - GreenDroid-GoogleAPIs] Could not find GreenDroid-GoogleAPIs.apk!
And in log cat error
02-13 18:10:17.115: E/AndroidRuntime(421): FATAL EXCEPTION: main
02-13 18:10:17.115: E/AndroidRuntime(421): java.lang.NoClassDefFoundError: com.cyrilmottier.android.greendroid.R$layout
02-13 18:10:17.115: E/AndroidRuntime(421): at greendroid.app.GDActivity.createLayout(GDActivity.java:177)
02-13 18:10:17.115: E/AndroidRuntime(421): at greendroid.app.GDActivity.ensureLayout(GDActivity.java:187)
02-13 18:10:17.115: E/AndroidRuntime(421): at greendroid.app.GDActivity.getActionBar(GDActivity.java:265)
02-13 18:10:17.115: E/AndroidRuntime(421): at com.singaporegp.f1.home.F1_Splash.onCreate(F1_Splash.java:41)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.os.Handler.dispatchMessage(Handler.java:99)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.os.Looper.loop(Looper.java:130)
02-13 18:10:17.115: E/AndroidRuntime(421): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-13 18:10:17.115: E/AndroidRuntime(421): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 18:10:17.115: E/AndroidRuntime(421): at java.lang.reflect.Method.invoke(Method.java:507)
02-13 18:10:17.115: E/AndroidRuntime(421): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-13 18:10:17.115: E/AndroidRuntime(421): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-13 18:10:17.115: E/AndroidRuntime(421): at dalvik.system.NativeStart.main(Native Method)
How can I solve this issue?

I've tried to try in order:
Check the project is not set as a library:
Go to Project->Properties
Select Android from left-hand side list
Uncheck the "Is Library" checkbox
Clean and rebuild the project - this should delete and recreate the entire gen folder, including the R.java file mentioned in some peoples answers
Check eclipse and all the Android plugins are up to date
Close the project, exit Eclipse, reopen eclipse, reopen the project.
Go to Java Build Path > Projects and check for any incorrect project dependencies
Go to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch'

Related

App crash running OpenCV apps in Android Emulator

I'm trying to use some emulators to run my apps for debugging. This app runs perfectly on my phone, but when I load it up into the emulator it crashes whenever I invoke an opencv function. The emulator is using the intel atom x86 cpu. Do I have to run them with the arm7?
Stack trace:
02-13 04:25:51.986: E/AndroidRuntime(2006): FATAL EXCEPTION: main
02-13 04:25:51.986: E/AndroidRuntime(2006): java.lang.ExceptionInInitializerError
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.uas.Processor.extract(Processor.java:48)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.uas.ImageProcessorActivity.onMenuItemClick(ImageProcessorActivity.java:626)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.widget.PopupMenu.onMenuItemSelected(PopupMenu.java:142)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.android.internal.view.menu.MenuPopupHelper.onItemClick(MenuPopupHelper.java:156)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.widget.AdapterView.performItemClick(AdapterView.java:298)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.widget.AbsListView.performItemClick(AbsListView.java:1100)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2749)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.widget.AbsListView$1.run(AbsListView.java:3423)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.os.Handler.handleCallback(Handler.java:725)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.os.Handler.dispatchMessage(Handler.java:92)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.os.Looper.loop(Looper.java:137)
02-13 04:25:51.986: E/AndroidRuntime(2006): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-13 04:25:51.986: E/AndroidRuntime(2006): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 04:25:51.986: E/AndroidRuntime(2006): at java.lang.reflect.Method.invoke(Method.java:511)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-13 04:25:51.986: E/AndroidRuntime(2006): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-13 04:25:51.986: E/AndroidRuntime(2006): at dalvik.system.NativeStart.main(Native Method)
02-13 04:25:51.986: E/AndroidRuntime(2006): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_java from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.uas-1.apk,libraryPath=/data/app-lib/com.uas-1]: findLibrary returned null
02-13 04:25:51.986: E/AndroidRuntime(2006): at java.lang.Runtime.loadLibrary(Runtime.java:365)
02-13 04:25:51.986: E/AndroidRuntime(2006): at java.lang.System.loadLibrary(System.java:535)
02-13 04:25:51.986: E/AndroidRuntime(2006): at org.opencv.core.Mat.<clinit>(Mat.java:2065)
02-13 04:25:51.986: E/AndroidRuntime(2006): ... 20 more

android VerifyError

i'm getting this message when i run my application i don't know why i'm getting it could any one help me. here is the logcat.
java.lang.VerifyError: com.kosh.me.Smaller
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
This happens when the build library classes conflict with those at run-time. Try performing a Clean of your project followed by a build.

How to upload file on google drive using my android application

I start with google drive sdk. I follows steps which describe in that post.
But I face problem in Step 3: Create and Configure an Android Project
I cant find options in my eclipse so I add plugins for google. After installation of plugins, Eclipse give errors and we now update my SDK also. So for that I update my SDK but now All projects giving me error in eclipse. I cant run any projects. So I use my old SDK back.
Now I stuck with this How to create Project for Google Drive and how to integrate it.
I need to upload file from my android application to Google Drive.
Please help me to find this.
EDIT
Now I successfully create project with error free. But when I run project it give me following errors.
12-12 11:05:08.788: E/AndroidRuntime(377): java.lang.NoClassDefFoundError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
12-12 11:05:08.788: E/AndroidRuntime(377): at com.rarenoice.screen.MainActivity.onCreate(MainActivity.java:42)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.os.Looper.loop(Looper.java:123)
12-12 11:05:08.788: E/AndroidRuntime(377): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-12 11:05:08.788: E/AndroidRuntime(377): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 11:05:08.788: E/AndroidRuntime(377): at java.lang.reflect.Method.invoke(Method.java:521)
12-12 11:05:08.788: E/AndroidRuntime(377): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-12 11:05:08.788: E/AndroidRuntime(377): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-12 11:05:08.788: E/AndroidRuntime(377): at dalvik.system.NativeStart.main(Native Method)
At Following line :-
private GoogleAccountCredential credential;
credential = GoogleAccountCredential.usingOAuth2(MainActivity.this,
DriveScopes.DRIVE);
You need to add the Google Play Services jars to your project, as explained in Step 3 of the quickstart guide you are following.
You can also watch this video where I go through all the steps to build the same quickstart application for Android: http://www.youtube.com/watch?v=Ied1CjJ0iP0

Sqliteexception while updating timestamp?

I have this code:
String sql="UPDATE LAST_OPEN SET LAST_OPEN="+DATE+" WHERE STUDENT_ID ="+STUDENT_ID+" AND ITEM_ID="+ITEM_ID+" AND ITEM_NAME="+ITEM_TYPE+";";
db.execSQL(sql);
Where LAST_OPEN field is timestamp.I tried to run the same query in SQlite Browser it was working fine.But when this Sql is executed in app it shows this:
02-13 13:12:39.468: E/AndroidRuntime(2366): FATAL EXCEPTION: main
02-13 13:12:39.468: E/AndroidRuntime(2366): android.database.sqlite.SQLiteException: near "13": syntax error: UPDATE LAST_OPEN SET LAST_OPEN=2012-02-13 13:12:39 WHERE STUDENT_ID =5 AND ITEM_ID=1 AND ITEM_NAME=Activity;
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
-13 13:12:39.468: E/AndroidRuntime(2366): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1727)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.cuelearn.databases.last_open.update(last_open.java:205)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.cuelearn.main.threeshelf$1.onClick(threeshelf.java:197)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.view.View.performClick(View.java:2408)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.view.View$PerformClick.run(View.java:8816)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.os.Handler.handleCallback(Handler.java:587)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.os.Handler.dispatchMessage(Handler.java:92)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.os.Looper.loop(Looper.java:123)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-13 13:12:39.468: E/AndroidRuntime(2366): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 13:12:39.468: E/AndroidRuntime(2366): at java.lang.reflect.Method.invoke(Method.java:521)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
Can anyone tell where I am getting wrong?
Try with this sql statement :
String sql="UPDATE LAST_OPEN SET LAST_OPEN='"+DATE+"' WHERE STUDENT_ID ="+STUDENT_ID+" AND ITEM_ID="+ITEM_ID+" AND ITEM_NAME="+ITEM_TYPE+";";
as I know, when you are using any string data in sql statement you need to add '' in the beginning of the variable and at the end of it.
Try to change
LAST_OPEN=2012-02-13 13:12:39
with
LAST_OPEN = "2012-02-13 13:12:39"
The space between the numbers can be the problem. Hope this helps.

java.lang.OutOfMemoryError bitmap create?

I just got this stack trace from the marketplace error reporting and have no idea where to being to track the problem down, any help appreciated.
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
at android.graphics.Bitmap.createBitmap(Bitmap.java:444)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:349)
at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:463)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:326)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.content.res.Resources.loadDrawable(Resources.java:1709)
at android.content.res.Resources.getDrawable(Resources.java:581)
at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:440)
at com.android.internal.view.menu.IconMenuItemView.initialize(IconMenuItemView.java:109)
at com.android.internal.view.menu.MenuItemImpl.createItemView(MenuItemImpl.java:594)
at com.android.internal.view.menu.MenuItemImpl.getItemView(MenuItemImpl.java:577)
at com.android.internal.view.menu.IconMenuView.updateChildren(IconMenuView.java:351)
at com.android.internal.view.menu.IconMenuView.initialize(IconMenuView.java:333)
at com.android.internal.view.menu.MenuBuilder$MenuType.getMenuView(MenuBuilder.java:199)
at com.android.internal.view.menu.MenuBuilder.getMenuView(MenuBuilder.java:323)
at com.android.internal.policy.impl.PhoneWindow.initializePanelContent(PhoneWindow.java:858)
at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:435)
at com.android.internal.policy.impl.PhoneWindow.onKeyUpPanel(PhoneWindow.java:621)
at com.android.internal.policy.impl.PhoneWindow.onKeyUp(PhoneWindow.java:1339)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1668)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
at android.widget.TabHost.dispatchKeyEvent(TabHost.java:278)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1687)
at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1120)
at android.app.Activity.dispatchKeyEvent(Activity.java:2073)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1663)
at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2560)
at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2535)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1867)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
I'm getting the same error on an application I've developed for Android 2.1 and Android 2.2 but run on Android 4.0.1 ICS. The same app would run on Android 2.1 but cause a crash with the above error on ICS. If you're drawing something relatively big to the size of the screen, consider checking from that place.

Categories

Resources