when I use an imageview in my app, it works fine on a galaxy s with android 2.2 and on the emulator with versions 2.1 & 2.2
however when I launch it on my phone ( xperia X10 mini pro with android 2.1) it crashes
The problem is definitely from the image view.
but I can't see where.
here's my code XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/white"
>
<ImageView
android:id="#+id/logo"
android:src="#drawable/logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
>
</ImageView>
<TextView
android:id="#+id/espace"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>
here's the logcat :
02-28 10:55:32.833 I/ActivityManager(1214): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.ecovalim/.startEco }
02-28 10:55:32.923 I/ActivityManager(1214): Start proc com.ecovalim for activity com.ecovalim/.startEco: pid=10784 uid=10087 gids={3003, 1015}
02-28 10:55:33.053 W/ResourceType(10784): Failure getting entry for 0x7f020015 (t=1 e=21) in package 0: 0xffffffb5
02-28 10:55:33.063 D/AndroidRuntime(10784): Shutting down VM
02-28 10:55:33.063 W/dalvikvm(10784): threadid=3: thread exiting with uncaught exception (group=0x40026160)
02-28 10:55:33.063 E/AndroidRuntime(10784): Uncaught handler: thread main exiting due to uncaught exception
02-28 10:55:33.093 E/AndroidRuntime(10784): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ecovalim/com.ecovalim.startEco}: android.view.InflateException: Binary XML file line #9: Error inflating class android.widget.ImageView
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2503)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.access$2200(ActivityThread.java:123)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.os.Looper.loop(Looper.java:123)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.main(ActivityThread.java:4370)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Method.invoke(Method.java:521)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-28 10:55:33.093 E/AndroidRuntime(10784): at dalvik.system.NativeStart.main(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class android.widget.ImageView
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.Activity.setContentView(Activity.java:1625)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.ecovalim.startEco.onCreate(startEco.java:30)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 11 more
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: java.lang.reflect.InvocationTargetException
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.widget.ImageView.<init>(ImageView.java:109)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Constructor.constructNative(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 22 more
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-ldpi/title_bar_shadow.9.png from drawable resource ID #0x7f020015
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.Resources.loadDrawable(Resources.java:1710)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.widget.ImageView.<init>(ImageView.java:119)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 26 more
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: java.io.FileNotFoundException: res/drawable-ldpi/title_bar_shadow.9.png
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.AssetManager.openNonAssetNative(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.AssetManager.openNonAsset(AssetManager.java:390)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.Resources.loadDrawable(Resources.java:1702)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 28 more
02-28 10:55:33.113 E/SemcCheckin(10784): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
02-28 10:55:33.113 W/ActivityManager(1214): Unable to start service Intent { act=com.sonyericsson.android.jcrashcatcher.action.BUGREPORT_AUTO cmp=com.sonyericsson.android.jcrashcatcher/.JCrashCatcherService (has extras) }: not found
02-28 10:55:33.153 I/Process (1214): Sending signal. PID: 10784 SIG: 3
02-28 10:55:33.153 I/dalvikvm(10784): threadid=7: reacting to signal 3
02-28 10:55:33.163 I/dalvikvm(10784): Wrote stack trace to '/data/anr/traces.txt'
02-28 10:55:33.223 E/SemcCheckin(6866): Get Crash Level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
02-28 10:55:34.793 I/Process (10784): Sending signal. PID: 10784 SIG: 9
02-28 10:55:34.793 I/ActivityManager(1214): Process com.ecovalim (pid 10784) has died.
02-28 10:55:34.803 I/UsageStats(1214): Unexpected resume of com.sonyericsson.homescreen while already resumed in com.ecovalim
02-28 10:55:34.833 W/InputManagerService(1214): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#45d8f048
02-28 10:55:35.643 I/ActivityManager(1214): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.nolanlawson.logcat/.LogcatActivity }
02-28 10:55:35.803 I/ActivityManager(1214): Displayed activity com.nolanlawson.logcat/.LogcatActivity: 130 ms (total 2921 ms)
02-28 10:55:36.043 D/dalvikvm(10689): GC freed 4019 objects / 330232 bytes in 79ms
02-28 10:55:36.433 D/dalvikvm(10689): GC freed 14022 objects / 1069568 bytes in 86ms
02-28 10:55:36.723 D/dalvikvm(10689): GC freed 5244 objects / 476048 bytes in 71ms
02-28 10:55:37.033 D/dalvikvm(10689): GC freed 5325 objects / 460208 bytes in 84ms
02-28 10:55:37.333 D/dalvikvm(10689): GC freed 4784 objects / 474496 bytes in 81ms
The reason for the error is that the xperia x10 mini has a screen that goes as 'small', meaning that it won't find the resources in your drawable-normal folder.
You can fix this by either adding a drawable folder without any special tags to fall back on if no other folders are available to the current configuration, or create one for each possible config, i.e. drawable-small, drawable-large and drawable-xlarge
Related
Thank you guys! The reason is somewhere simpler than I think. I feel something futility.. :
-)
I have already added activity names on androidmanifest.xml.
My code is simple.
Intent intent=new Intent(MainActivity.this, AddAddressActivity.class);
intent.putExtra("respond", responsebody);
intent.putExtra("userid", txtID.getText().toString());
intent.putExtra("password", txtPW.getText().toString());
MainActivity.this.startActivity(intent);
just this.
Why are crashes caused in this code? I can't find on it.
But the more stranger thing is that crash aren't caused when I make AddAddressActivity like basic templete(source when it is made at first).
Then, is AddAddressActivity a problem?
Thanks to read my question. You could misunderstand it because of my short english. If you have something hard to understand, please ask me on comment.
Here is Logcat. I can't find reason in this text..
02-28 02:42:53.876: D/dalvikvm(6195): GC_FOR_ALLOC freed 122K, 19% free 9983K/12192K, paused 17ms, total 17ms
02-28 02:42:53.886: I/dalvikvm-heap(6195): Grow heap (frag case) to 15.536MB for 3936016-byte allocation
02-28 02:42:53.901: D/dalvikvm(6195): GC_FOR_ALLOC freed <1K, 14% free 13826K/16036K, paused 13ms, total 13ms
02-28 02:42:54.011: D/dalvikvm(6195): GC_FOR_ALLOC freed <1K, 14% free 13826K/16036K, paused 9ms, total 9ms
02-28 02:42:54.031: I/dalvikvm-heap(6195): Grow heap (frag case) to 30.549MB for 15744016-byte allocation
02-28 02:42:54.041: D/dalvikvm(6195): GC_FOR_ALLOC freed 0K, 8% free 29201K/31412K, paused 11ms, total 11ms
02-28 02:42:54.201: D/libEGL(6195): loaded /system/lib/egl/libEGL_mali.so
02-28 02:42:54.201: D/libEGL(6195): loaded /system/lib/egl/libGLESv1_CM_mali.so
02-28 02:42:54.206: D/libEGL(6195): loaded /system/lib/egl/libGLESv2_mali.so
02-28 02:42:54.211: E/(6195): Device driver API match
02-28 02:42:54.211: E/(6195): Device driver API version: 23
02-28 02:42:54.211: E/(6195): User space API version: 23
02-28 02:42:54.211: E/(6195): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct 30 09:36:10 KST 2013
02-28 02:42:54.276: D/OpenGLRenderer(6195): Enabling debug mode 0
02-28 02:43:02.696: I/webclipboard(6195): clipservice: android.sec.clipboard.ClipboardExManager#4419e048
02-28 02:43:02.711: D/AndroidRuntime(6195): Shutting down VM
02-28 02:43:02.711: W/dalvikvm(6195): threadid=1: thread exiting with uncaught exception (group=0x420ac700)
02-28 02:43:02.721: E/AndroidRuntime(6195): FATAL EXCEPTION: main
02-28 02:43:02.721: E/AndroidRuntime(6195): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mcdelivery/com.example.mcdelivery.AddAddressActivity}: java.lang.NullPointerException
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.ActivityThread.access$700(ActivityThread.java:168)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.os.Looper.loop(Looper.java:137)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.ActivityThread.main(ActivityThread.java:5493)
02-28 02:43:02.721: E/AndroidRuntime(6195): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 02:43:02.721: E/AndroidRuntime(6195): at java.lang.reflect.Method.invoke(Method.java:525)
02-28 02:43:02.721: E/AndroidRuntime(6195): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
02-28 02:43:02.721: E/AndroidRuntime(6195): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
02-28 02:43:02.721: E/AndroidRuntime(6195): at dalvik.system.NativeStart.main(Native Method)
02-28 02:43:02.721: E/AndroidRuntime(6195): Caused by: java.lang.NullPointerException
02-28 02:43:02.721: E/AndroidRuntime(6195): at com.example.mcdelivery.AddAddressActivity.onCreate(AddAddressActivity.java:18)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.Activity.performCreate(Activity.java:5372)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
02-28 02:43:02.721: E/AndroidRuntime(6195): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
02-28 02:43:02.721: E/AndroidRuntime(6195): ... 11 more
02-28 02:43:02.751: V/webkit(6195): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {4419b1f0}
AddAddressActivity.java
package com.example.mcdelivery;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
public class AddAddressActivity extends Activity {
WebView webview;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_addaddress);
Intent intent=new Intent(this.getIntent());
webview.loadUrl("https://www.mcdelivery.co.kr/kr/jsp/sys/customerLogin.do?userName=" + intent.getStringExtra("username") + "&password=" + intent.getStringExtra("password") + "&imgLogin.x=0&imgLogin.y=0");
}
}
webView gives a NPE on this line
webview.loadUrl("https://www.mcdelivery.co.kr/kr/jsp/sys/customerLogin.do?userName=" + intent.getStringExtra("username") + "&password=" + intent.getStringExtra("password") + "&imgLogin.x=0&imgLogin.y=0");
Because you haven't yet initialized it. You only declare it
WebView webview;
Somewhere (before that line and after setContentView()) you need to initialize it
You have only declared WebView not initialized it
setContentView(R.layout.activity_addaddress);
webview =(WebView)findViewById(R.id.webView); //missing
Intent intent= getIntent();
webview.loadUrl("https://www.mcdelivery.co.kr/kr/jsp/sys/customerLogin.do?userName=" + intent.getStringExtra("username") + "&password=" + intent.getStringExtra("password") + "&imgLogin.x=0&imgLogin.y=0");
I think that's from a bad handling of the Context belonging to your app.
Replace
Intent intent=new Intent(MainActivity.this, AddAddressActivity.class);
with
Intent intent=new Intent(this, AddAddressActivity.class); .
I am currently using AVOS cloud with login. But there is a login error whenever i tried to login.
The error shows:
E/AVUncaughtExceptionHandler(25353): AVUncaughtExceptionHandler caught a NullPointerException exception
02-28 17:43:42.002: E/AndroidRuntime(26902): FATAL EXCEPTION: main
02-28 17:43:42.002: E/AndroidRuntime(26902): com.alibaba.fastjson.JSONException: write javaBean error
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:193)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:330)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.JSON.toJSONString(JSON.java:388)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.avos.avoscloud.AVUser.changeCurrentUser(AVUser.java:108)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.avos.avoscloud.AVUser$2.onSuccess(AVUser.java:387)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.avos.avoscloud.GetHttpResponseHandler.onSuccess(GetHttpResponseHandler.java:87)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.loopj.android.http.AsyncHttpResponseHandler.handleMessage(AsyncHttpResponseHandler.java:364)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.loopj.android.http.AsyncHttpResponseHandler$ResponderHandler.handleMessage(AsyncHttpResponseHandler.java:134)
02-28 17:43:42.002: E/AndroidRuntime(26902): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 17:43:42.002: E/AndroidRuntime(26902): at android.os.Looper.loop(Looper.java:130)
02-28 17:43:42.002: E/AndroidRuntime(26902): at android.app.ActivityThread.main(ActivityThread.java:3691)
02-28 17:43:42.002: E/AndroidRuntime(26902): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 17:43:42.002: E/AndroidRuntime(26902): at java.lang.reflect.Method.invoke(Method.java:507)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
02-28 17:43:42.002: E/AndroidRuntime(26902): at dalvik.system.NativeStart.main(Native Method)
02-28 17:43:42.002: E/AndroidRuntime(26902): Caused by: com.alibaba.fastjson.JSONException: write javaBean error
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:193)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.MapSerializer.write(MapSerializer.java:130)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
02-28 17:43:42.002: E/AndroidRuntime(26902): ... 15 more
02-28 17:43:42.002: E/AndroidRuntime(26902): Caused by: com.alibaba.fastjson.JSONException: write javaBean error
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:193)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.CollectionSerializer.write(CollectionSerializer.java:96)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:116)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
02-28 17:43:42.002: E/AndroidRuntime(26902): ... 18 more
02-28 17:43:42.002: E/AndroidRuntime(26902): Caused by: com.alibaba.fastjson.JSONException: write javaBean error
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:193)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
02-28 17:43:42.002: E/AndroidRuntime(26902): ... 21 more
02-28 17:43:42.002: E/AndroidRuntime(26902): Caused by: java.lang.reflect.InvocationTargetException
02-28 17:43:42.002: E/AndroidRuntime(26902): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 17:43:42.002: E/AndroidRuntime(26902): at java.lang.reflect.Method.invoke(Method.java:507)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.util.FieldInfo.get(FieldInfo.java:220)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.FieldSerializer.getPropertyValue(FieldSerializer.java:88)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:148)
02-28 17:43:42.002: E/AndroidRuntime(26902): ... 23 more
02-28 17:43:42.002: E/AndroidRuntime(26902): Caused by: java.lang.IllegalStateException: unable to encode an association with an unsaved AVObject
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.avos.avoscloud.AVRelation.getQuery(AVRelation.java:102)
02-28 17:43:42.002: E/AndroidRuntime(26902): at com.avos.avoscloud.AVRelation.getQuery(AVRelation.java:87)
02-28 17:43:42.002: E/AndroidRuntime(26902): ... 28 more
My current avos version is 2.3.2.1 with Eclipse IDE
I resolve it by deleting the relation column to roles. Appendly, AVOS clouds relation with roles doesn't really works as well (at least for this version - 2.3.2.1 ). This is not the first time I met error for relational tables in AVOS-cloud. I would suggest avoid the relational tables (especially for user-roles relation)
Thank you for your question.
I'm the Android Developer from AVOS Cloud.
I find the root cause of this bug and will update the fix in the next release 2.4.1 in next week.
I have a game in Google Play. It have been working fine in the previous 3 updates. But in the 4th after you download and install the update the game crashes only in Android 4.1.1 devices.
It happens because somehow GooglePlay installed incorrectly the application and the native library is not correctly set up.
Reading some Google forms I believe this is know problem of that android firmware. I already worked around that by saving the native library in the res files and coping it to /data/data/com.minix.android.Game/files and loading it from there. Yet the players lost all of their progress, like if the corrupt installation clears the game data.
02-28 15:40:49.050: W/dalvikvm(23159): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/minix/android/Game;
02-28 15:40:49.050: W/dalvikvm(23159): Class init failed in newInstance call (Lcom/minix/android/Game;)
02-28 15:40:49.050: D/AndroidRuntime(23159): Shutting down VM
02-28 15:40:49.050: W/dalvikvm(23159): threadid=1: thread exiting with uncaught exception (group=0x410382a0)
02-28 15:40:49.050: D/KeyguardViewMediator(2465): setHidden false
02-28 15:40:49.050: D/WindowManager(2465): mInputFocus is not null.
02-28 15:40:49.050: D/WindowManager(2465): mInputFocus is not null.
02-28 15:40:49.050: E/AndroidRuntime(23159): FATAL EXCEPTION: main
02-28 15:40:49.050: E/AndroidRuntime(23159): java.lang.ExceptionInInitializerError
02-28 15:40:49.050: E/AndroidRuntime(23159): at java.lang.Class.newInstanceImpl(Native Method)
02-28 15:40:49.050: E/AndroidRuntime(23159): at java.lang.Class.newInstance(Class.java:1319)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.app.ActivityThread.access$600(ActivityThread.java:140)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.os.Looper.loop(Looper.java:137)
02-28 15:40:49.050: E/AndroidRuntime(23159): at android.app.ActivityThread.main(ActivityThread.java:4898)
02-28 15:40:49.050: E/AndroidRuntime(23159): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 15:40:49.050: E/AndroidRuntime(23159): at java.lang.reflect.Method.invoke(Method.java:511)
02-28 15:40:49.050: E/AndroidRuntime(23159): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
02-28 15:40:49.050: E/AndroidRuntime(23159): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
02-28 15:40:49.050: E/AndroidRuntime(23159): at dalvik.system.NativeStart.main(Native Method)
02-28 15:40:49.050: E/AndroidRuntime(23159): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load minix: findLibrary returned null
02-28 15:40:49.050: E/AndroidRuntime(23159): at java.lang.Runtime.loadLibrary(Runtime.java:365)
02-28 15:40:49.050: E/AndroidRuntime(23159): at java.lang.System.loadLibrary(System.java:535)
02-28 15:40:49.050: E/AndroidRuntime(23159): at com.minix.android.Game.GameActivity <clinit>(Unknown Source)
02-28 15:40:49.050: E/AndroidRuntime(23159): ... 15 more
Several reasons that might cause this:
You don't have this in your code:
static {
System.loadLibrary("mylibraryname");
}
You changed your package name in the code or in the package itself and they don't match.
You use an expired or invalid signature to sign your app.
There is my used project: http://code.google.com/p/droidreader/
when I try to run my project, I got a problem loading my library "pdfrender"
Here is the line causing the problem: System.loadLibrary("pdfrender");
In my project, I have a floader named jni and contain the library pdfrender.c
Here is my logcat:
02-28 10:57:55.241: E/AndroidRuntime(596): java.lang.ExceptionInInitializerError
02-28 10:57:55.241: E/AndroidRuntime(596): at de.hilses.droidreader.DroidReaderActivity.onCreate(DroidReaderActivity.java:108)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.Activity.performCreate(Activity.java:4465)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.os.Looper.loop(Looper.java:137)
02-28 10:57:55.241: E/AndroidRuntime(596): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.reflect.Method.invoke(Method.java:511)
02-28 10:57:55.241: E/AndroidRuntime(596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-28 10:57:55.241: E/AndroidRuntime(596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-28 10:57:55.241: E/AndroidRuntime(596): at dalvik.system.NativeStart.main(Native Method)
02-28 10:57:55.241: E/AndroidRuntime(596): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load pdfrender: findLibrary returned null
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.Runtime.loadLibrary(Runtime.java:365)
02-28 10:57:55.241: E/AndroidRuntime(596): at java.lang.System.loadLibrary(System.java:535)
02-28 10:57:55.241: E/AndroidRuntime(596): at de.hilses.droidreader.PdfRender.<clinit>(PdfRender.java:111)
02-28 10:57:55.241: E/AndroidRuntime(596): ... 15 more
finally i found the solution we have to install ndk-android and cygwin. then we are able to build .so from .c file.
For more explanation you can see this, it helped me very much:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
> Couldn't load (library) pdfrender
If you build with eclipse make shure that the library pdfrender in the build-path is marked as Exported (checkbox before lib is set).
Then it should be included into the build apk-file
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.falling.inairproandmark/com.falling.inairproandmark.Q9Popup}: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
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)
Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:219)
at android.app.Activity.setContentView(Activity.java:1647)
at com.falling.inairproandmark.Q9Popup.onCreate(Q9Popup.java:36)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at android.widget.Button.<init>(Button.java:65)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 22 more
Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.content.res.Resources.loadDrawable(Resources.java:1709)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1885)
at android.widget.TextView.<init>(TextView.java:352)
at android.widget.Button.<init>(Button.java:69)
... 26 more
==
here's my xml layout:
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:background="#drawable/q9popup" android:id="#+id/qnine"
android:layout_width="fill_parent" android:layout_height="fill_parent">
</Button>
<com.google.ads.AdView android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="**********"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
</AbsoluteLayout>
I don't understand why I keep getting this error :S
Please help.
Thanks
Android cannot allocate the memory for the Button. Pre-Honeycomb allocates the memory for a bitmap natively, outside the Dalvik VM, using malloc and has to rely on Java finalizers to free that memory again. Unless you call Bitmap.recycle that is.
See http://www.youtube.com/watch?v=_CruQY55HOk&feature=player_detailpage#t=650s for some info on allocation of Bitmaps.
So you have to figure out why external allocation is so high in your app. Maybe AdMob is the cause. Make sure to invoke AdView.destroy in your activity's onDestroy.