Titanium Android App Markeplace Build not starting - android

I made an Android app with Titanium Studio. It works perfecly as long as i run it in debug mode but as soon as i use the apk that's generated by the built in marketplace distribution my app gets stuck when the loading screen is shown. No error Message is displayed.
I created a keystore and verified the apk after it was built. no errors.
Any idea what i need to change?
DDMS:
11-13 21:57:26.142: I/ActivityManager(477): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.xxxx.xxxx/.xxxxActivity bnds=[360,74][536,302]} from pid 767
11-13 21:57:26.142: W/ContextImpl(477): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1078 com.android.server.am.ActivityStack.SendToPermission:2575 com.android.server.am.ActivityStack.startActivityUncheckedLocked:3177 com.android.server.am.ActivityStack.startActivityLocked:2788 com.android.server.am.ActivityStack.startActivityMayWait:3343
11-13 21:57:26.149: D/PowerManagerService(477): acquireWakeLockInternal: lock=1112740064, flags=0x1, tag="ActivityManager-Launch", ws=null, uid=1000, pid=477
11-13 21:57:26.149: D/PowerManagerNotifier(477): onWakeLockAcquired: flags=1, tag="ActivityManager-Launch", ownerUid=1000, ownerPid=477, workSource=null
11-13 21:57:26.149: D/PowerManagerService(477): Update history[5] wakeLock: flags=0x1, tag="ActivityManager-Launch", uid=1000, pid=477, timeStamp=1384376246150, timeSum=8638
11-13 21:57:26.149: D/PowerManagerService(477): updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x1
11-13 21:57:26.149: D/PowerManagerService(477): updateScreenStateLocked: mDisplayReady=true, newScreenState=2, mWakefulness=1, mWakeLockSummary=0x1, mUserActivitySummary=0x1, mBootCompleted=true
11-13 21:57:26.156: I/ComBroadcastReceiver(28917): ComBroadcastReceiver action = android.server.am.ActivityStack.taskstatechange
11-13 21:57:26.166: I/ActivityManager(477): Start proc com.xxxx.xxxx for activity com.xxxx.xxxx/.xxxxActivity: pid=10596 uid=10176 gids={50176, 1015, 3003, 1028}
11-13 21:57:26.179: I/dalvikvm(10596): Turning on JNI app bug workarounds for target SDK version 10...
11-13 21:57:26.202: D/Sensors(477): sensors_poll_context_t->activate(handle: 0, enabled: 1)
11-13 21:57:26.202: D/PowerManagerService(477): handleSandman: canDream=false, mWakefulness=Awake
11-13 21:57:26.206: D/Sensors(477): virtual int AccelerometerSensor::enable(int32_t, int): fd (230 ),en (1),flags(1), mEnabled(0),input_sys_path (/sys/class/input/event4/device/device/enable)
11-13 21:57:26.206: D/Sensors(477): sensors_poll_context_t->setDelay(handle: 0, ns: 200000000)
11-13 21:57:26.206: D/Sensors(477): sensors_poll_context_t->setDelay(handle: 0, ns: 66667000)
11-13 21:57:26.206: W/ActivityRecord(477): goujw packagename: com.xxxx.xxxx
11-13 21:57:26.209: W/ActivityRecord(477): goujw userId: 0
11-13 21:57:26.242: D/CubicBezierInterpolator(477): CubicBezierInterpolator mControlPoint1x = 0.5, mControlPoint1y = 0.2, mControlPoint2x = 0.6, mControlPoint2y = 1.0
11-13 21:57:26.249: W/System.err(10596): java.io.FileNotFoundException: /data/cust/xml/hw_launcher_load_icon.xml: open failed: ENOENT (No such file or directory)
11-13 21:57:26.249: W/System.err(10596): at libcore.io.IoBridge.open(IoBridge.java:409)
11-13 21:57:26.252: I/PowerManagerService(477): state=2
11-13 21:57:26.252: W/System.err(10596): at java.io.FileInputStream.<init>(FileInputStream.java:109)
11-13 21:57:26.252: W/System.err(10596): at android.content.res.ResourcesEx.readDefaultConfig(ResourcesEx.java:808)
11-13 21:57:26.252: W/System.err(10596): at android.content.res.ResourcesEx.<init>(ResourcesEx.java:741)
11-13 21:57:26.252: W/System.err(10596): at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1721)
11-13 21:57:26.252: W/System.err(10596): at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1752)
11-13 21:57:26.256: W/System.err(10596): at android.app.LoadedApk.getResources(LoadedApk.java:485)
11-13 21:57:26.256: W/System.err(10596): at android.app.ContextImpl.init(ContextImpl.java:1911)
11-13 21:57:26.256: W/System.err(10596): at android.app.ContextImpl.init(ContextImpl.java:1904)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4269)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread.access$1300(ActivityThread.java:145)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
11-13 21:57:26.256: W/System.err(10596): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 21:57:26.256: W/System.err(10596): at android.os.Looper.loop(Looper.java:137)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread.main(ActivityThread.java:5095)
11-13 21:57:26.256: W/System.err(10596): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 21:57:26.256: W/System.err(10596): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 21:57:26.256: W/System.err(10596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
11-13 21:57:26.256: W/System.err(10596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
11-13 21:57:26.256: W/System.err(10596): at dalvik.system.NativeStart.main(Native Method)
11-13 21:57:26.256: W/System.err(10596): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-13 21:57:26.259: W/System.err(10596): at libcore.io.Posix.open(Native Method)
11-13 21:57:26.259: W/System.err(10596): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-13 21:57:26.259: W/System.err(10596): at libcore.io.IoBridge.open(IoBridge.java:400)
11-13 21:57:26.259: W/System.err(10596): ... 19 more
11-13 21:57:26.272: I/TiApplication(10596): (main) [0,0] checkpoint, app created.
11-13 21:57:26.356: W/System.err(10596): Invalid int: ""
11-13 21:57:26.416: I/TiApplication(10596): (main) [141,141] Titanium 3.1.3 (2013/09/18 12:01 222f4d1)
11-13 21:57:26.482: I/TiApplication(10596): (main) [68,209] Titanium Javascript runtime: v8
11-13 21:57:26.482: D/dalvikvm(10596): Trying to load lib /data/app-lib/com.xxxx.xxxx-2/libstlport_shared.so 0x424249f0
11-13 21:57:26.486: D/dalvikvm(10596): Added shared lib /data/app-lib/com.xxxx.xxxx-2/libstlport_shared.so 0x424249f0
11-13 21:57:26.486: D/dalvikvm(10596): No JNI_OnLoad found in /data/app-lib/com.xxxx.xxxx-2/libstlport_shared.so 0x424249f0, skipping init
11-13 21:57:26.486: D/dalvikvm(10596): Trying to load lib /data/app-lib/com.xxxx.xxxx-2/libkroll-v8.so 0x424249f0
11-13 21:57:26.496: D/dalvikvm(10596): Added shared lib /data/app-lib/com.xxxx.xxxx-2/libkroll-v8.so 0x424249f0
11-13 21:57:26.502: I/TiRootActivity(10596): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
11-13 21:57:26.502: I/TiApplication(10596): (main) [1,1] Analytics have been disabled
11-13 21:57:26.706: W/V8Object(10596): Runtime disposed, cannot set property 'userAgent'

Related

Writing to SD Card always failing

I am trying to move files from any location (including internal device storage)
to SD Card,
For that I Have
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
in my manifest, and checked that it did work by checking if premissions are granted using :
Contex.checkCallingOrSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE") and Contex.checkCallingOrSelfPermission("android.permission.READ_EXTERNAL_STORAGE")
and I have tried 3 diffrent ways to do that :
Files.move(original, newPath1), which comes with Guava com.google.common.io
this method :
public static void move(File src, File dst) throws IOException {
FileInputStream inStream = new FileInputStream(src);
FileOutputStream outStream = new FileOutputStream(dst);
FileChannel inChannel = inStream.getChannel();
FileChannel outChannel = outStream.getChannel();
inChannel.transferTo(0, inChannel.size(), outChannel);
inStream.close();
outStream.close();
}
original.renameTo(newPath1);
I read alot of SO posts about this, and all solutions i tried did not work, I made sure the SD Card is mounted, and that i didnt have my device connected to PC while trying. I even tried 2 diffrent devices with SD Cards. Notice that i could access the image with BitmapFactory.decode() with the exact same path and i could load that image to imageview.
I am always getting EACCES (Permission denied). I dont know what else to do to solve this :(
11-13 11:11:54.358 19192-19372/xaday.ofek.ron.xaday W/System.err: java.io.FileNotFoundException: /storage/sdcard1/DCIM/thai2/IMG-20150702-WA0001.jpg: open failed: EACCES (Permission denied)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.IoBridge.open(IoBridge.java:465)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at com.google.common.io.Files$FileByteSink.openStream(Files.java:245)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at com.google.common.io.Files$FileByteSink.openStream(Files.java:233)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at com.google.common.io.ByteSource.copyTo(ByteSource.java:248)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at com.google.common.io.Files.copy(Files.java:458)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at com.google.common.io.Files.move(Files.java:673)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at xaday.ofek.ron.xaday.XaDayIntentService.handleActionMove(XaDayIntentService.java:128)
11-13 11:11:54.369 19192-19372/xaday.ofek.ron.xaday W/System.err: at xaday.ofek.ron.xaday.XaDayIntentService.onHandleIntent(XaDayIntentService.java:84)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.os.Looper.loop(Looper.java:211)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.Posix.open(Native Method)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.IoBridge.open(IoBridge.java:451)
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: ... 12 more
11-13 11:11:54.370 19192-19372/xaday.ofek.ron.xaday W/System.err: java.io.FileNotFoundException: /storage/sdcard1/DCIM/thai2/IMG-20150702-WA0001.jpg: open failed: EACCES (Permission denied)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.IoBridge.open(IoBridge.java:465)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at xaday.ofek.ron.xaday.FileUtils.move(FileUtils.java:36)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at xaday.ofek.ron.xaday.XaDayIntentService.handleActionMove(XaDayIntentService.java:136)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at xaday.ofek.ron.xaday.XaDayIntentService.onHandleIntent(XaDayIntentService.java:84)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.os.Looper.loop(Looper.java:211)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.Posix.open(Native Method)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: at libcore.io.IoBridge.open(IoBridge.java:451)
11-13 11:11:54.371 19192-19372/xaday.ofek.ron.xaday W/System.err: ... 9 more
Just to make sure I was not locking the file in some way, I used another file manager app to execute the same file move - and it worked! why is it not working for me?!
anyone has an idea?
On Android Kitkat (4.4), Google has changed how the developers can access to the removable storage (SD card). Quoting from source.android.com:
The WRITE_EXTERNAL_STORAGE permission must only grant write access to
the primary external storage on a device. Apps must not be allowed to
write to secondary external storage devices, except in their
package-specific directories as allowed by synthesized permissions.
Restricting writes in this way ensures the system can clean up files
when applications are uninstalled.
For this reason, even with the WRITE_EXTERNAL_STORAGE permission, you can't write on the SD card on KitKat and higher versions.
On Android Lollipop (5.0), Google adds a new set of API that allows the developers to manage the file on the SD Card through the Storage Access Framework.
This StackOverflow answer explains in detail how to use the new APIs and the existing limitations:
How to use the new SD card access API presented for Android 5.0 (Lollipop)?
Is the "uses-permission" tag outside of the "application" tag in the manifest.xml?

single WebView layout to view urls from my main activity

I want to reuse a custom xml which I for various links from my main Activity.
I assume it's using a LayoutInflater.
But I am struggling with the code.
I was using the main_Activity xml for the code originally.
But I thought it would save space in the app if it inflated the same WebView for all the links within the app.
this is the xml for the custom layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:id="#+id/MyWebView">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/webViewCustom">
</WebView>
</LinearLayout>
then this is the Java code I have tried.
I think that might be where my problem lies
switch (position){
case 0:
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(view.getWidth(),view.getHeight());
lp.leftMargin = (int) view.getX();
lp.topMargin = (int) view.getY();
LayoutInflater li = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
RelativeLayout ll = (RelativeLayout) li.inflate(R.layout.custom_webview, null);
webViewCustom.getSettings().setJavaScriptEnabled(true);
webViewCustom.getSettings().setBuiltInZoomControls(true);
webViewCustom.loadUrl(AeonnoxCusBckGrndMJDUrl);
MjdLayout.addView(ll, lp);
break;
this is how originaly had it within my mainActivity java. and each link has a seperate webView attached to a drawer. but i want 1 Activity that inflates/Opens all links when each button is pressed it just reuses the one view
TrustedSellersDrawer.openDrawer(MJDwebViewDrawerRight);
MJDwebViewDrawerRight.getSettings().setJavaScriptEnabled(true);
MJDwebViewDrawerRight.getSettings().setBuiltInZoomControls(true);
MJDwebViewDrawerRight.loadUrl(AeonnoxCusBckGrndMJDUrl);
The logcat
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:409)
11-13 18:13:46.578 552-587/? W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
11-13 18:13:46.578 552-587/? W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
11-13 18:13:46.578 552-587/? W/System.err﹕ at com.sec.android.hardware.SecHardwareInterface.setBatteryADC(SecHardwareInterface.java:393)
11-13 18:13:46.578 552-587/? W/System.err﹕ at com.android.server.power.PowerManagerService$DisplayBlankerImpl$1.run(PowerManagerService.java:5324)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.Looper.loop(Looper.java:146)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.HandlerThread.run(HandlerThread.java:61)
11-13 18:13:46.578 552-587/? W/System.err﹕ Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.Posix.open(Native Method)
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:393)
11-13 18:13:46.578 552-587/? W/System.err﹕ ... 8 more
my last few questions have been marked down quite alot for unknown reasons, so please be nice.

android google map v.2 : android.view.InflateException: Binary XML file line #739: Error inflating class fragment

I found similar topics in stackoverflow but it didn't help for me. I want to show map, but when i run it, it return force close. Here are the codes :
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
this is my layout :
<fragment
android:id="#+id/map"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:layout_margin="20dp"
class="com.google.android.gms.maps.MapFragment" />
this is my manifest :
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_API_KEY" />
</application>
this my logcat :
11-13 16:03:10.652: E/AndroidRuntime(32202): FATAL EXCEPTION: main
11-13 16:03:10.652: E/AndroidRuntime(32202): java.lang.RuntimeException: Unable to start activity ComponentInfo{id.go.kpp.aplikasipupi/id.go.kpp.aplikasipupi.kartu}: android.view.InflateException: Binary XML file line #739: Error inflating class fragment
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.access$600(ActivityThread.java:140)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.os.Looper.loop(Looper.java:137)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.main(ActivityThread.java:4895)
11-13 16:03:10.652: E/AndroidRuntime(32202): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 16:03:10.652: E/AndroidRuntime(32202): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
11-13 16:03:10.652: E/AndroidRuntime(32202): at dalvik.system.NativeStart.main(Native Method)
11-13 16:03:10.652: E/AndroidRuntime(32202): Caused by: android.view.InflateException: Binary XML file line #739: Error inflating class fragment
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Activity.setContentView(Activity.java:1912)
11-13 16:03:10.652: E/AndroidRuntime(32202): at id.go.kpp.aplikasipupi.kartu.onCreate(kartu.java:100)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Activity.performCreate(Activity.java:5163)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
11-13 16:03:10.652: E/AndroidRuntime(32202): ... 11 more
11-13 16:03:10.652: E/AndroidRuntime(32202): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.internal.q.v(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.internal.q.u(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapFragment$b.cE(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.dynamic.a.a(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Activity.onCreateView(Activity.java:4813)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
11-13 16:03:10.652: E/AndroidRuntime(32202): ... 24 more
i don't know why it still error, i hope somebody can help me to solve my problem.
The logcat is clear
You need to add the below to manifest file
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
https://developers.google.com/maps/documentation/android/start#add_the_google_play_services_version_to_your_apps_manifest
Edit your application's AndroidManifest.xml file, and add the following declaration within the <application> element. This embeds the version of Google Play services that the app was compiled with.
I got the same exception as well, but I figured out for Google API v2 to work, you must include these permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
I hope this will help you guys.
P.S I used these permissions for adding a simple map in my app. There are certain other permissions which this link suggests as well.

Android SQLite multiple table input

I have a budget program that uses multiple tables to store information. When I try to add information to more than 1 table at a time, I end up only having the first table receive any information. This is the code I use:
public SQLiteDatabase createBudget(String bname, String bpay, String bamount,
String bmemo) {
// TODO Auto-generated method stub
ContentValues t1 = new ContentValues();
ContentValues t2 = new ContentValues();
ContentValues t4 = new ContentValues();
t1.put(KEY_NAME, bname);
t1.put(KEY_PAYDAY,bpay);
t2.put(KEY_AMOUNT, bamount);
t4.put(KEY_MEMO, bmemo);
ourDatabase.insert(DATABASE_TABLE1, null, t1);
ourDatabase.insert(DATABASE_TABLE2, null, t2);
ourDatabase.insert(DATABASE_TABLE4, null, t4);
return ourDatabase;
}
I'm completely lost on what to do. I have tried looking online but the things I have found are for single table database. I would appreciate any help. This is LogCat content:
11-13 10:14:33.935: E/SQLiteDatabase(662): Error inserting budget_amount=99
11-13 10:14:33.935: E/SQLiteDatabase(662): android.database.sqlite.SQLiteConstraintException: Budget_Items.edit_date may not be NULL (code 19)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:775)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1339)
11-13 10:14:33.935: E/SQLiteDatabase(662): at budget.app.BudgetDB.createBudget(BudgetDB.java:161)
11-13 10:14:33.935: E/SQLiteDatabase(662): at budget.app.AddBudget$1.onClick(AddBudget.java:40)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.view.View.performClick(View.java:4084)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.view.View$PerformClick.run(View.java:16966)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.os.Handler.handleCallback(Handler.java:615)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.os.Looper.loop(Looper.java:137)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-13 10:14:33.935: E/SQLiteDatabase(662): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 10:14:33.935: E/SQLiteDatabase(662): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 10:14:33.935: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-13 10:14:33.935: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-13 10:14:33.935: E/SQLiteDatabase(662): at dalvik.system.NativeStart.main(Native Method)
11-13 10:14:33.955: E/SQLiteDatabase(662): Error inserting _memo=for pie
11-13 10:14:33.955: E/SQLiteDatabase(662): android.database.sqlite.SQLiteConstraintException: Budget_Memos.edit_date may not be NULL (code 19)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:775)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1339)
11-13 10:14:33.955: E/SQLiteDatabase(662): at budget.app.BudgetDB.createBudget(BudgetDB.java:162)
11-13 10:14:33.955: E/SQLiteDatabase(662): at budget.app.AddBudget$1.onClick(AddBudget.java:40)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.view.View.performClick(View.java:4084)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.view.View$PerformClick.run(View.java:16966)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.os.Handler.handleCallback(Handler.java:615)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.os.Looper.loop(Looper.java:137)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-13 10:14:33.955: E/SQLiteDatabase(662): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 10:14:33.955: E/SQLiteDatabase(662): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 10:14:33.955: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-13 10:14:33.955: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-13 10:14:33.955: E/SQLiteDatabase(662): at dalvik.system.NativeStart.main(Native Method)
I think the problem is "Budget_Items.edit_date may not be NULL". You have a NOT NULL column in your database and try to insert a row without giving a value at the column Budget_Items.edit_date
Your constrain exception is very much visible here
android.database.sqlite.SQLiteConstraintException: Budget_Items.edit_date may not be NULL (code 19)
Try putting a try catch block around your calls to find the exact error.

Android adding adMob not Working

I have been trying to add adMob on my application, but I have naver been able to make it work on my app. Finally I have downloaded a sample adMob app from adMob's web site. However, that doesn't work either. And I get that log below:
11-13 18:24:21.477: D/AndroidRuntime(2225): Shutting down VM
11-13 18:24:21.477: W/dalvikvm(2225): threadid=1: thread exiting with uncaught exception (group=0xb40cb180)
11-13 18:24:21.507: E/AndroidRuntime(2225): FATAL EXCEPTION: main
11-13 18:24:21.507: E/AndroidRuntime(2225): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.example.ads.xml/com.google.example.ads.xml.BannerSample}: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.ads.AdView
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.os.Looper.loop(Looper.java:137)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.main(ActivityThread.java:4424)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-13 18:24:21.507: E/AndroidRuntime(2225): at dalvik.system.NativeStart.main(Native Method)
11-13 18:24:21.507: E/AndroidRuntime(2225): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.ads.AdView
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.Activity.setContentView(Activity.java:1835)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.google.example.ads.xml.BannerSample.onCreate(BannerSample.java:14)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.Activity.performCreate(Activity.java:4465)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-13 18:24:21.507: E/AndroidRuntime(2225): ... 11 more
11-13 18:24:21.507: E/AndroidRuntime(2225): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView
11-13 18:24:21.507: E/AndroidRuntime(2225): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
11-13 18:24:21.507: E/AndroidRuntime(2225): ... 21 more
11-13 18:24:21.798: I/dalvikvm(2225): threadid=3: reacting to signal 3
11-13 18:24:21.808: I/dalvikvm(2225): Wrote stack traces to '/data/anr/traces.txt'
11-13 18:24:22.148: I/dalvikvm(2225): threadid=3: reacting to signal 3
11-13 18:24:22.158: I/dalvikvm(2225): Wrote stack traces to '/data/anr/traces.txt'
I have gotten this error before, when I got it it was because I had accidentally removed the admobSDK.jar from my application. However, it seems more likely that the below solution will work better for you.
If you are using ADT r17 or higher, then you need to create a libs/ folder in your project, and then copy the adMob SDK into that folder.
Here is another similar post
Error inflating class com.google.ads.AdView

Categories

Resources