Android app with Phonegap crashes on landscape rotation - android

I created an Android app with Phonegap. When the app runs and I flip the phone into landscape it simply crashes. I already tried adding this to my manifest:
android:configChanges="orientation|keyboardHidden"
also tried:
android:configChanges="orientation|screenSize|keyboardHidden"
No effect. Any suggestions?
Update:
This is what logcat tells me when the app crashes: http://dl.dropbox.com/u/17844821/zeug/logcat.txt
Update:
This is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.foo.bar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden"
android:name=".MainActivity"
android:label="#string/title_activity_main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Make sure that put those in the activity tag like this:
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize
|locale">
and close it after them.
I have this problem once and I made this mistake.

Do you have the INTERNET permission in your AndroidManifest.xml? Based on the exception it looks like the CallbackServer can't open a socket which would cause a bunch of problems.

Related

Including AndroidManifest.xml in a Unity3D build causes mobile application to instantly crash

I have an issue where the inclusion of an AndroidManifest.xml file in a android build of a Unity3D project causes the application to instantly crash upon opening. However not including the file causes the application to not be able to access the internet. I'm not very familiar with the structure of manifest xml files so any help would be greatly appreciated.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.DefaultCompany.DynamoDB"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.amazonaws.unity.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.amazonaws.unity.permission.C2D_MESSAGE" />
<application
android:theme="#android:style/Theme.NoTitleBar"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
</manifest>
try UnityPlayerActivity instead
UnityPlayerNativeActivity
and check this package name package="com.DefaultCompany.DynamoDB" . maybe it should be package="com.amazonaws.unity"

I am Getting this error "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED" .how do i solve it?

I am getting this error.Please help me. I tried to solve this but i could not.Thanks in advance.This is my Manifest file. Please tell what are the things that i need to change or add.Please explain why ? Explanation would be preferred.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Puzzle1024.angry2048"
android:versionCode="3"
android:versionName="2" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<supports-screens
android:largeScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name" >
<activity
android:name="Puzzle1024.angry2048.app.MainGame"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden|adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="Puzzle1024.angry2048.Screen"></activity>
</application>
</manifest>
system package name should contain only lower case characters.
package="Puzzle1024.angry2048"
P is caps.
In such a case usually do following:
check the manifest-file for syntax errors
clean your project (e.g. build->clean or delete /bin-folder and sometimes /gen-folder)
go to the project/package explorer
right-click on the manifest-file
VALIDATE!
Everything should be fine now.

Android App tablet compaitablity

I am currently working on an app for my University, and everything is working great. Except Tablet compatibility. Below is my AndroidManifest file, does anypne have suggestions on what is wrong. The play store says "This app is not compatible with this device"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rmu.mobile.tcdev"
android:versionCode="3"
android:versionName="0.0.3" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<uses-permission
android:name="android.permission.CALL_PHONE"
android:required="False"
/>
<uses-permission
android:name="android.permission.INTERNET"
/>
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:anyDensity="true"
android:largeScreens="true"
android:xlargeScreens="true"
/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/RealTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:allowBackup="true"
>
<activity
android:name="com.rmu.mobile.tcdev.RMULayoutsActivity"
android:label="#string/app_name"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- <activity android:name=".ActionItemsSampleActivity" /> -->
</application>
</manifest>
android:required is not a valid attribute for uses-permission. Instead, you must add
<uses-feature android:name="android.hardware.telephony"
android:required="false" />
This depends on what the device you are running on it has installed. You have a min SDK version of 8. There are many devices that are running below that. Also, taking a look at my own code, the "supports screen" category is not 100% necessary.

Google Play excludes devices

I have the following AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.app"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:theme="#style/Theme.Transparent" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="my.app.layouts.Dashboard"
android:configChanges="keyboardHidden"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:exported="false"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
As you can see it uses the ZXing library to read a barcode. The app however is not getting shown on certrain devices (such as the Nexus 7) in Google Play.
How can I include ALL devices since I do my error handling inside the App itself (For example show dialogs if camera is not available etc.)?
Use uses-feature as well as this at the end: android:required="false"
Also I'm not sure if you need the support any-density part in your AndroidManifest.
instead of uses-permission use uses-feature and set the flag to optional
uses-permission sets uses-feature to required by default

Yet another AdMob 4.3.1 "you must have AdActivity" issue-

I have read every single question on here about the "you must have AdActivity declared in AndroidManifest.xml with configChanges" error.
I've also tried every single solution offered. Changed the target sdk in project.properties, etc.
I'm stumped. Not that it is any different than all the others, but here is my manifest:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name=".Main"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
/>
</application>
Using version 4.3.1. Have created the libs folder, added the jar, did project clean, exited and restarted eclipse, EVERYTHING I could think of. Any suggestions?
adMob AdActivity should be like this...
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >
</activity>

Categories

Resources