4

I am having a huge problem to deploy my app for 4.1.1 Android Tablet. It works on 4.4.2./4.3.2. Phones or with Meteor run android-device. However when build the bundle for production it fails with error -103 (found with logcat).

Since it runs on newer Droid the problem is not signature keys or the app. I have read that you have to manually meteor configure-android, delete the AVD and create a new one with the desired droid version, which did not help at all.

Modifying AndroidManifest.xml, specifying android:targetSdkVersion="15" and modifying project.properities to target 15 did not help either.

For the sake completness here is my AndoridManifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" android:windowSoftInputMode="adjustPan" package="xyz" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:debuggable="false" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTask" android:name="rpaircztechnician" android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:clearTaskOnLaunch="true" android:configChanges="orientation|keyboardHidden" android:exported="false" android:name="com.google.zxing.client.android.CaptureActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">
            <intent-filter>
                <action android:name="com.phonegap.plugins.barcodescanner.SCAN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:label="@string/share_name" android:name="com.google.zxing.client.android.encode.EncodeActivity">
            <intent-filter>
                <action android:name="com.phonegap.plugins.barcodescanner.ENCODE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:label="@string/share_name" android:name="com.google.zxing.client.android.HelpActivity">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-feature android:name="android.hardware.camera" android:required="false" />
</manifest>

and my build process

#remove old apk version
echo "Removing old APK version"
rm ../../_production/xyz/xyz.apk
echo "Removing old APK version - done"

#create bundle with unaligned apk
echo "Building the app"
meteor build ../../_build/ --server http://expamle.com --mobile-settings ./settings.json
echo "Building the app - done"

#sign the apk
echo "Signing the APK"
jarsigner -digestalg SHA1 ../../_build/xyz/android/unaligned.apk xyz
echo "Signing the APK - done"

#zipalign it to production apk
echo "Zipaligning and moving"
~/.meteor/android_bundle/android-sdk/build-tools/21.0.0/zipalign 4 ../../_build/xyz/android/unaligned.apk ../../_production/xyz/xyz.apk
echo "Zipaligning and moving - done"

Thanks for any help!

David Reinberger
  • 540
  • 3
  • 11
  • One thing you could try is [custom cordova config.xml](https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration#advanced-build-customization) in combination with the android-targetSdkVersion option as described in this [link](http://docs.build.phonegap.com/en_US/2.9.0/configuring_preferences.md.html#Preferences) – battery Feb 20 '15 at 04:25
  • I've opened a ticket on Meteor's repo regarding this some time ago: https://github.com/meteor/meteor/issues/3802. – Tomas Romero Apr 23 '15 at 17:38

1 Answers1

4

I had the same problem. Here is what works for me (notice the specification of -sigalc MD5withRSA):

keytool -genkey -alias MyApp -keyalg RSA -keysize 2048 -validity 10000 -keystore sample.keystore

jarsigner -keystore sample.keystore -digestalg SHA1 -sigalg MD5withRSA -tsa http://timestamp.digicert.com  unaligned.apk MyApp

~/.meteor/android_bundle/android-sdk/build-tools/21.0.0/zipalign -f -v 4 unaligned.apk myapp.apk
Miriam
  • 471
  • 5
  • 20
  • An other issue which the app does not build might be wrong environment variables: http://stackoverflow.com/questions/31111478/how-to-execute-an-meteorcordova-tutorial-like-solomo-on-my-samsung-galaxy-s3 – Jakob Alexander Eichler Jun 29 '15 at 10:38