Issue adding gridlayout support library to project? - android

When I click on my widget, which uses the gridlayout support library, I get this error:
10-12 17:15:14.373: E/dalvikvm(3957): Could not find class 'com.example.awesomefilebuilderwidget.Drag_and_Drop_App$MyDragListener', referenced from method com.example.awesomefilebuilderwidget.Drag_and_Drop_App.onCreate
10-12 17:15:14.433: E/AndroidRuntime(3957): FATAL EXCEPTION: main
10-12 17:15:14.433: E/AndroidRuntime(3957): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.awesomefilebuilderwidget/com.example.awesomefilebuilderwidget.Drag_and_Drop_App}: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.GridLayout
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1833)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1854)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1041)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.os.Handler.dispatchMessage(Handler.java:99)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.os.Looper.loop(Looper.java:150)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.ActivityThread.main(ActivityThread.java:4333)
10-12 17:15:14.433: E/AndroidRuntime(3957): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 17:15:14.433: E/AndroidRuntime(3957): at java.lang.reflect.Method.invoke(Method.java:507)
10-12 17:15:14.433: E/AndroidRuntime(3957): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-12 17:15:14.433: E/AndroidRuntime(3957): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-12 17:15:14.433: E/AndroidRuntime(3957): at dalvik.system.NativeStart.main(Native Method)
10-12 17:15:14.433: E/AndroidRuntime(3957): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.GridLayout
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-12 17:15:14.433: E/AndroidRuntime(3957): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:231)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.Activity.setContentView(Activity.java:1712)
10-12 17:15:14.433: E/AndroidRuntime(3957): at com.example.awesomefilebuilderwidget.Drag_and_Drop_App.onCreate(Drag_and_Drop_App.java:22)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1797)
10-12 17:15:14.433: E/AndroidRuntime(3957): ... 11 more
10-12 17:15:14.433: E/AndroidRuntime(3957): Caused by: java.lang.reflect.InvocationTargetException
10-12 17:15:14.433: E/AndroidRuntime(3957): at java.lang.reflect.Constructor.constructNative(Native Method)
10-12 17:15:14.433: E/AndroidRuntime(3957): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
10-12 17:15:14.433: E/AndroidRuntime(3957): ... 20 more
10-12 17:15:14.433: E/AndroidRuntime(3957): Caused by: java.lang.NoClassDefFoundError: android.support.v7.gridlayout.R$dimen
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.support.v7.widget.GridLayout.<init>(GridLayout.java:255)
10-12 17:15:14.433: E/AndroidRuntime(3957): at android.support.v7.widget.GridLayout.<init>(GridLayout.java:274)
10-12 17:15:14.433: E/AndroidRuntime(3957): ... 23 more
I followed the official android developers guidelines to add the support library to my project but I am still getting the errors.
As I believe this is more or less my fault somewhere along the line heres the steps I took to add it:
1)Went to File->Import->Existing Android Code into Workspace->found the v7 gridlayout file and clicked finish
2)Went to the support gridlayout package and to the libs folder, right clicked on the .jar file, and added it to my build path (I did the same with the bin file)
3)Clicked on my own project->Properties->Library pane->Add JARs (as seen below)
Then I also have the order and export tab as marked below:
Then the two libs show up in my projects "Referenced Libraries" section.
But no matter what I do, I still get that same error. Did I go about doing this correctly?

Your steps are incorrect. Instead of this:
3)Clicked on my own project->Properties->Library pane->Add JARs (as
seen below)
Do this (from the Adding libraries with resources section in the instructions):
In the Project Explorer, right-click your project and select Properties.
In the Library pane, click Add.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.
Except use gridlayout instead of appcompat, of course
Also, the remaining steps that you did (with the Build and Export tab) should be done to the gridlayout project, not your own project (also detailed in the same section of the instructions).

Related

style runtime errors occures

when I change the value in the values-v14/styles.xml file from:
parent="Theme.AppCompat.Light.DarkActionBar" to:
parent="android:Theme.Holo"
the application crushes and the logcat says: runtime error!
what should I do?
Here's the logcat:
10-12 09:09:29.850: E/AndroidRuntime(1910): FATAL EXCEPTION: main
10-12 09:09:29.850: E/AndroidRuntime(1910): Process: absolute.begginners.hellouniverse, PID: 1910
10-12 09:09:29.850: E/AndroidRuntime(1910): java.lang.RuntimeException: Unable to start activity ComponentInfo{absolute.begginners.hellouniverse/absolute.begginners.hellouniverse.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.access$800(ActivityThread.java:135)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.os.Handler.dispatchMessage(Handler.java:102)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.os.Looper.loop(Looper.java:136)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.main(ActivityThread.java:5017)
10-12 09:09:29.850: E/AndroidRuntime(1910): at java.lang.reflect.Method.invokeNative(Native Method) 10-12 09:09:29.850: E/AndroidRuntime(1910): at java.lang.reflect.Method.invoke(Method.java:515)
10-12 09:09:29.850: E/AndroidRuntime(1910): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
10-12 09:09:29.850: E/AndroidRuntime(1910): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
10-12 09:09:29.850: E/AndroidRuntime(1910): at dalvik.system.NativeStart.main(Native Method)
10-12 09:09:29.850: E/AndroidRuntime(1910): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:110)10-12 09:09:29.850: E/AndroidRuntime(1910): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:99)
10-12 09:09:29.850: E/AndroidRuntime(1910): at absolute.begginners.hellouniverse.MainActivity.onCreate(MainActivity.java:13)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.Activity.performCreate(Activity.java:5231)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
10-12 09:09:29.850: E/AndroidRuntime(1910): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
10-12 09:09:29.850: E/AndroidRuntime(1910): ... 11 more
Your class extends ActionBarActivity that's why you can only use the AppCompat theme.
If you want to use holo, make your class extend Activity. Example
public class MainActivity extends Activity {
...
}
I had to set my main.xml to the following
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>

Android App asks to force close on Emulator on Flash Builder 4.6

I am new to Android app development and using Flash Builder 4.6. My apps work fine on the desktop, but after installing the app in the emulator and trying to open it, I get The application process air.nameofapp has stopped unexpectedly. Please try again. in the debug mode, I do not see any error but once I get the above error I see the following in the Logcat:
10-12 17:07:17.019: E/dalvikvm(452): Could not find class 'com.adobe.air.AIRWindowSurfaceView$2', referenced from method com.adobe.air.AIRWindowSurfaceView.DoSetOnSystemUiVisibilityChangeListener
10-12 17:07:17.688: E/AndroidRuntime(452): FATAL EXCEPTION: main
10-12 17:07:17.688: E/AndroidRuntime(452): java.lang.UnsatisfiedLinkError: nativeOnFormatChangeListener
10-12 17:07:17.688: E/AndroidRuntime(452): at com.adobe.air.AIRWindowSurfaceView.nativeOnFormatChangeListener(Native Method)
10-12 17:07:17.688: E/AndroidRuntime(452): at com.adobe.air.AIRWindowSurfaceView.surfaceChanged(AIRWindowSurfaceView.java:683)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.SurfaceView.updateWindow(SurfaceView.java:549)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:348)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.View.draw(View.java:6883)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.SurfaceView.draw(SurfaceView.java:334)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.View.draw(View.java:6883)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.widget.FrameLayout.draw(FrameLayout.java:357)
10-12 17:07:17.688: E/AndroidRuntime(452): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1862)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewRoot.draw(ViewRoot.java:1522)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.os.Handler.dispatchMessage(Handler.java:99)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.os.Looper.loop(Looper.java:123)
10-12 17:07:17.688: E/AndroidRuntime(452): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-12 17:07:17.688: E/AndroidRuntime(452): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 17:07:17.688: E/AndroidRuntime(452): at java.lang.reflect.Method.invoke(Method.java:507)
10-12 17:07:17.688: E/AndroidRuntime(452): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-12 17:07:17.688: E/AndroidRuntime(452): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-12 17:07:17.688: E/AndroidRuntime(452): at dalvik.system.NativeStart.main(Native Method)

Android GPS Check Crashing?

Searched around extensively since yesterday and can't find anyone with this problem:
I created a GPS check function that simply returns true or false indicating whether or not the GPS is on. This works just fine in android 2.2 and 4.1 on the emulator and on a phone running 4.1.
The function is the following:
private Boolean checkGPSEnabled(){
try{
String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if(provider.toLowerCase().contains("gps")){
return true;
}
}
catch(IllegalArgumentException e){
return true;
}
return false;
}
The problem is, when GPS is enabled when performing this check on the Android emulator, the emulator crashes outright.
Here is what is printed out in the LogCat when the error occurs:
10-12 15:23:45.593: W/dalvikvm(899): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
10-12 15:23:45.644: E/AndroidRuntime(899): FATAL EXCEPTION: main
10-12 15:23:45.644: E/AndroidRuntime(899): java.lang.IllegalStateException: Could not execute method of the activity
10-12 15:23:45.644: E/AndroidRuntime(899): at android.view.View$1.onClick(View.java:3591)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.view.View.performClick(View.java:4084)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.view.View$PerformClick.run(View.java:16966)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.os.Handler.handleCallback(Handler.java:615)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.os.Looper.loop(Looper.java:137)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-12 15:23:45.644: E/AndroidRuntime(899): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 15:23:45.644: E/AndroidRuntime(899): at java.lang.reflect.Method.invoke(Method.java:511)
10-12 15:23:45.644: E/AndroidRuntime(899): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-12 15:23:45.644: E/AndroidRuntime(899): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-12 15:23:45.644: E/AndroidRuntime(899): at dalvik.system.NativeStart.main(Native Method)
10-12 15:23:45.644: E/AndroidRuntime(899): Caused by: java.lang.reflect.InvocationTargetException
10-12 15:23:45.644: E/AndroidRuntime(899): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 15:23:45.644: E/AndroidRuntime(899): at java.lang.reflect.Method.invoke(Method.java:511)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.view.View$1.onClick(View.java:3586)
10-12 15:23:45.644: E/AndroidRuntime(899): ... 11 more
10-12 15:23:45.644: E/AndroidRuntime(899): Caused by: java.lang.IllegalArgumentException: requested provider network doesn't exisit
10-12 15:23:45.644: E/AndroidRuntime(899): at android.os.Parcel.readException(Parcel.java:1429)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.os.Parcel.readException(Parcel.java:1379)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:646)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.location.LocationManager._requestLocationUpdates(LocationManager.java:660)
10-12 15:23:45.644: E/AndroidRuntime(899): at android.location.LocationManager.requestLocationUpdates(LocationManager.java:482)
10-12 15:23:45.644: E/AndroidRuntime(899): at com.desmill.taxi.activity.TaxiCaller.callTaxi(TaxiCaller.java:52)
10-12 15:23:45.644: E/AndroidRuntime(899): ... 14 more
Any ideas? How do I get it to show the other errors where it says ...14 more...?
Thanks!
You can dump the logcat output to a text file, you should be able to read it there, although I'm not positive. Just open a terminal window, navigate to the directory with your adb executable (unless it is in your PATH) and type:
adb logcat -d > logcat.txt
Another useful command for clearing logcat's contents is:
adb logcat -c
This works for me in 2.2+
try {
LocationManager locManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
gps_enabled = locManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
} catch (Exception e) {
}

Amazon java.lang.VerifyError Android

I have been trying to submit 2 separate apps into the Amazon App store but they keep being rejected. Here is the stack trace for the first:
11-05 11:14:36.488 E/AndroidRuntime(28128): FATAL EXCEPTION: AsyncTask #1
11-05 11:14:36.488 E/AndroidRuntime(28128): java.lang.RuntimeException: An error occured while executing doInBackground()
11-05 11:14:36.488 E/AndroidRuntime(28128): at android.os.AsyncTask$3.done(AsyncTask.java:200)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.lang.Thread.run(Thread.java:1096)
11-05 11:14:36.488 E/AndroidRuntime(28128): Caused by: java.lang.VerifyError: com.companionfree.WLThemeViewer.AmazonClientManager
11-05 11:14:36.488 E/AndroidRuntime(28128): at com.companionfree.WLThemeViewer.UpdateDBs.doInBackground(UpdateDBs.java)
11-05 11:14:36.488 E/AndroidRuntime(28128): at com.companionfree.WLThemeViewer.UpdateDBs.doInBackground(UpdateDBs.java)
11-05 11:14:36.488 E/AndroidRuntime(28128): at android.os.AsyncTask$2.call(AsyncTask.java:185)
11-05 11:14:36.488 E/AndroidRuntime(28128): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-05 11:14:36.488 E/AndroidRuntime(28128): ... 4 more
And the relevant logcat for the second
10-12 15:41:48.929 D/dalvikvm( 2451): GC_FOR_MALLOC freed 8099 objects / 524416 bytes in 34ms
10-12 15:41:49.327 I/RPC ( 1563): rx thread timeout (1 clients):
10-12 15:41:49.828 I/RPC ( 1563): rx thread timeout (1 clients):
10-12 15:41:50.089 I/ActivityManager( 1563): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.companionfree.pushup/.MainScreen }
10-12 15:41:50.099 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeafa50), pid=1563, w=1, h=1
10-12 15:41:50.099 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeafa50), pid=1563, w=1, h=1
10-12 15:41:50.139 D/SurfaceFlinger( 1563): Layer::requestBuffer(this=0xeafa50), index=0, pid=1563, w=480, h=800 success
10-12 15:41:50.189 I/ActivityManager( 1563): Start proc com.companionfree.pushup for activity com.companionfree.pushup/.MainScreen: pid=2644 uid=10129 gids={1015, 3003}
10-12 15:41:50.319 I/RPC ( 1563): rx thread timeout (1 clients):
10-12 15:41:50.359 W/dalvikvm( 2644): VFY: Lcom/companionfree/pushup/WorkoutDbAdapter; is not instance of Landroid/app/Activity;
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: bad arg 0 (into Landroid/app/Activity;)
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: rejecting call to Lcom/amazon/android/Kiwi;.onActivityResult (Landroid/app/Activity;IILandroid/content/Intent;)Z
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: rejecting opcode 0x71 at 0x0000
10-12 15:41:50.369 W/dalvikvm( 2644): VFY: rejected Lcom/companionfree/pushup/WorkoutDbAdapter;.onActivityResult (IILandroid/content/Intent;)V
10-12 15:41:50.369 W/dalvikvm( 2644): Verifier rejected class Lcom/companionfree/pushup/WorkoutDbAdapter;
10-12 15:41:50.369 D/AndroidRuntime( 2644): Shutting down VM
10-12 15:41:50.369 W/dalvikvm( 2644): threadid=1: thread exiting with uncaught exception (group=0x40025a70)
10-12 15:41:50.369 E/AndroidRuntime( 2644): FATAL EXCEPTION: main
10-12 15:41:50.369 E/AndroidRuntime( 2644): java.lang.VerifyError: com.companionfree.pushup.WorkoutDbAdapter
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.companionfree.pushup.MainScreen.onCreateMainScreen(MainScreen.java)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.companionfree.pushup.MainScreen.onCreate(MainScreen.java)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2802)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2859)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.access$2300(ActivityThread.java:136)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.os.Handler.dispatchMessage(Handler.java:99)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.os.Looper.loop(Looper.java:143)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at android.app.ActivityThread.main(ActivityThread.java:5073)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at java.lang.reflect.Method.invoke(Method.java:521)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-12 15:41:50.369 E/AndroidRuntime( 2644): at dalvik.system.NativeStart.main(Native Method)
10-12 15:41:50.379 W/ActivityManager( 1563): Force finishing activity com.companionfree.pushup/.MainScreen
10-12 15:41:50.399 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeff6b8), pid=1563, w=1, h=1
10-12 15:41:50.399 D/SurfaceFlinger( 1563): Layer::setBuffers(this=0xeff6b8), pid=1563, w=1, h=1
10-12 15:41:50.419 D/SurfaceFlinger( 1563): Layer::requestBuffer(this=0xeff6b8), index=0, pid=1563, w=480, h=337 success
10-12 15:41:50.469 D/dalvikvm( 2451): GC_FOR_MALLOC freed 7889 objects / 521072 bytes in 105ms
10-12 15:41:50.819 I/RPC ( 1563): rx thread timeout (1 clients):
I see the same verify error on both but I can't figure it out. The only common library used between the 2 apps is the FlurryAgent.jar for analytics.
For the top app I have
For the bottom app I have
in the manifests. The only information I have been able to find out is about libraries (GSON) and needing to use dx but I am using Eclipse so that doesn't help.
To make this more difficult, the error does NOT occur on the Android Market. Yet the testers at Amazon say that it FC 5/5 times on each of their devices (I tried using an emulator for their test devices and they worked fine). I know they use "wrapper" code around my app and I think it must be interfering in some way.
Does anyone have any experience with this?
I had a similar problem - resolved it by removing the non activity class from AndroidManifest.xml
Amazon injects their own code into your apps Activities life-cycle events. Knowing that and looking at the log you've provided:
10-12 15:41:50.359 W/dalvikvm( 2644): VFY: Lcom/companionfree/pushup/WorkoutDbAdapter; is not instance of Landroid/app/Activity;
It appears that Amazon's code tried to instrument a class (WorkoutDbAdapter) which is NOT an Activity (doesn't extends Activity), ending up being rejected by the JVM's verifier.
With my app this happened since the class was listed was listed an an Activity on AndroidManifest.xml. Removing this listing from AndroidManifest.xml resolved the issue and the app was admitted to the market.
Sarp wrote that renaming your class' packaged solved the issue, perhaps by doing so you've made your listing on AndroidManifest.xml no longer relevant. Thereby circumventing the problem.
I'd say this is the problem of the Amazon. Apparently they are injecting some DRM code into your apk: Injecting code into APK
Other people are seeing similar errors - Android app issue (Amazon)
In my case, the class that was causing a VerifyError was in a package called util. It was probably clashing with an injected package by Amazon, because renaming it to utils solved the problem.
Because our app was using Facebook SDK, it was given a "No, I will sign my binary" option when uploading a new binary. When you upload an unsigned APK this way, Amazon will let you download the processed binary (that includes their injected code) as Step 2 so that you can sign it. I was able to download a copy of my APK that crashes, and test my changes without going through the approval process this way.
I just solved my problem and may help to you
I just update the AS to 2.0 and ADT, and the verify issue come out
finally, be careful with the constructor like:
class abc {
abc(int x) {
....
}
abc(byte x) {
....
}
}

Android Smack chat client

Hi freinds I an using Smack3.2.1.jar downloaded from following url
http://www.igniterealtime.org/downloads/index.jsp
I added jar to my buildpath But when I run the application I get the following Error log
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): FATAL EXCEPTION: main
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): java.lang.VerifyError: org.jivesoftware.smack.sasl.SASLMechanism
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.Class.getDeclaredConstructors(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.Class.getConstructor(Class.java:477)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:314)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.jivesoftware.smack.Connection.login(Connection.java:348)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at org.apache.android.xmpp.SettingsDialog.onClick(SettingsDialog.java:54)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.view.View.performClick(View.java:2408)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.view.View$PerformClick.run(View.java:8816)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Handler.handleCallback(Handler.java:587)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.os.Looper.loop(Looper.java:123)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at java.lang.reflect.Method.invoke(Method.java:521)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-12 13:11:59.464: ERROR/AndroidRuntime(1957): at dalvik.system.NativeStart.main(Native Method)
Can anyone help ...
Smack doesn't work on android out of the box, you may want to use aSmack (http://code.google.com/p/asmack/) which is a port of smack for Android.
Finally I got the Concrete implementation
Anyone who want to develop chat client then follow the steps mentioned below.
Go to link
http://www.beem-project.com/projects/beem/files
Download
asmack-android-7-source-beem.zip
Now modify this source as per your requirement.
You will find the lib asmack-android-7-beem.jar to obtain javadoc for this lib its same as javadoc for smack what i did is as follows.
Download source smack-3.2.1 from link below
http://www.igniterealtime.org/downloads/index.jsp
When you extract the jar you will get the folder named javadoc now just attach this folder to asmack-android-7-beem.jar by going to the properties of your project.
Hip Hip Hurray....
You can't use vanilla Smack prior Smack 4 on Android. Have a look at "Android and XMPP: Currently available solutions"
use dependencies inject this in your build.gradle
compile 'org.igniterealtime.smack:smack-android:4.1.6'
compile 'org.igniterealtime.smack:smack-tcp:4.1.6'
compile 'org.igniterealtime.smack:smack-im:4.1.6'
compile 'org.igniterealtime.smack:smack-extensions:4.1.6'

Categories

Resources