"There was a problem parsing the package" when installing my app - android

I had to reinstall my computer. Now, when I'm launching my app from Eclipse on the virtual device, it works fine. However, when I create a distribution, the .apk file is only half the size it used to be so far and gives a
"There was a problem parsing the package"
error message when trying to install the fresh .apk on my phone (Android version 4.1.2).
My manifest contains
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
I have the latest Android SDK tools etc. as well as API v8, v15 and v17 installed.
In "Project Build Target" (project properties), API 15 is checked. Lower than the one on my phone, so this common solution for this error message doesn't seem to apply in my case.
The distribution is using the default proguard-android-optimize.txt .
The fact that that the size of the .apk has halved made me suspect proguard, but even when I removed all options from its config file, the problem exists. I'm puzzled.

Related

android - admob implmetation confusion

I have implemented admob code as given in google site (http://code.google.com/mobile/ads/docs/android/fundamentals.html) as described in google site we should target android 3.2 (api-13) in eclipse IDE to work properly. now my problem is my application targeting the android version 1.6 and above, since i made build target as andoird 3.2 it expects app should run on either 3.2 emulator or any of 3.2 device. i tried even installing on my 2.2 device but it didnt work.
Please help.
Thanks
The only thing you need to do is follow their instruction:
Requirements
The Google AdMob Ads SDK for Android requires Android 1.5 or later. Make sure you have the latest copy of the Android SDK and that you're compiling against at least Android v3.2 (set target in default.properties to android-13).
Using Android SDK Tool download android-13 SDK and modify your default.properties, do not change anything else like android:minSdkVersion in AndroidManifest.xml. Yes, you will get a little yellow warning message says version not match in Eclipse, just ignore it and build your application, you should be fine.

Android Device Chooser doesn't list emulators with older APIs than the build version

My application is built on 2.2, but it is backwards compatible down to 1.6. I've used reflection for the newer methods.
When I try to run it on an emulator in Eclipse, it only lists my 2.2 AVDs. I need to test on 1.6 to ensure compatibility.
I've tried building with Android 2.2 and with Google APIs 2.2 with no luck. (what's the difference, anyway?)
I have set <uses-sdk android:minSdkVersion="4" targetSDK="8"/> in my manifest. I also tried targetSDK="4".
Thanks.
Open AVD manager, start 1.6 emulator. Run project in eclipse - started 1.6 emulator will be in the list.
You can't build to a 1.6 emulator when your app is built on 2.2. You can however, do the opposite. Build your project on 1.6 and as long as you set android:minSdkVersion you can build to all emulators higher than that version.
Right click on your project in the Package Explorer.
Select Properties.
Select Android.
Under Project Build target select API 4 (1.6).
Hit OK.
Now when you build your project it can build on a 1.6 emulator assuming you have one setup.

How to change the minSDK Version in eclipse?

While creating a new android project in eclipse 3.5, i have selected Android 2.1 Update1 as build target. But i forgot to give the mini SDK version. Now when the build the project, its giving a warning message "WARNING: Application does not specify an API level requirement!Device API version is 8 (Android 2.2)"
The application is running fine..but when i run that application is my Samsung Galaxy S which is having android 2.1, the application is behaving differently.
I have even tried adding
<uses-sdk minSdkVersion="7" /> in the manifest file..But still i am getting the warning message..
So how can i change the mini SDK of my project in eclipse to 7,so that i get the same result in my emulator and Mobile phone?
Thanks in advance
Shijilal
In your manifest there should be something like this
<uses-sdk android:minSdkVersion="int" />
Now just change the number to the desired version number. Additionally you should also change the value of the target in the default.properties file.

Set install location for Android 1.6?

I'm writing an application that is compatible with Android 1.6, but I would like to give users running Android 2.2 the option of moving the application installation to their sd card.
How can I compile my application for 1.6, but still allow 2.2 users to install it to their sd?
In your manifest:
In <manifest>, add "android:installLocation="preferExternal"
Keep your current uses-sdk as "<uses-sdk android:minSdkVersion="4">"
Then go to Project > Properties > Android (on the left), change the build target to 2.2, and you're all set.
Your project will build using 2.2 (but still only requires 1.6), but devices running 1.6 will simply ignore your new "installLocation" setting in the manifest. Just be careful not to add any 2.2-introduced material in your actual code, since the compiler will no longer catch it.
This is not quite as seamless as the developer guide suggests.
First, the application does not build when the installLocation is present in the manifest and the build target is set to anything other than 2.2:
error: No resource identifier found for attribute 'installLocation' in
package 'android'
So in order to test backwards-compatibililty by setting the build target to 1.6, the manifest must be edited as well.
Second, once the build target is set to 2.2, I don't get to pick an emulator with a lower API level for testing. I can still manually start an 1.6 emulator and run the app on it, though, but I am curious if my app will appear on Android Market for 1.6 devices if my build target is 2.2 (even though minSdkVersion=4). I don't have an actual device to test. Can someone confirm that this does not affect the availability on the market?
Lastly, this warning remains:
Attribute minSdkVersion (4) is lower than the project target API level (8)

.apk file not working on device

i took an android project and imported it in eclipse. in properties->android section it is showing platform 1.6 and API level 4. I have downloaded Android 2.2. Now when i try to make some changes in the source code and make an .apk file and try to install on my android device the device shows an error : Application not installed. the project is not showing any error but it is showing a warning : Attribute minSdkVersion (3) is lower than the project target API level (4) in manifest file. the person who gave me th eproject i asked him to mail his .apk file to me and that .apk file is running perfectly on the device. Please advice.
Change to API level 3 (Android 1.5), that must be the solution. you must have in your manifest.xml defined a minSdkVersion = 3
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
or change the minSdkVersion to Api level 4 at your manifest.xml file that correspond to android 1.6
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
build, create and sign your .apk again
alternatively you could try this:
when application run on emulator it creates an .apk file on project/bin folder. you just connect your android phone with usb mass storage and then copy this apk to SD card. it will then install the app on phone by clicking the apk file on phone. i've faced the same problem and now i've successfully installed my apps on t mobile G1.

Categories

Resources