我在为4.1.1 Android平板电脑部署我的应用时遇到了很大的问题。它适用于4.4.2./4.3.2。电话或Meteor run android-device
。但是,当为生产构建bundle时,它会失败并显示error -103
(与logcat一起找到)。
由于它在较新的Droid上运行,问题不在于签名密钥或应用程序。我已经读过你必须手动meteor configure-android
,删除AVD并创建一个带有所需droid版本的新版本,这根本没用。
修改AndroidManifest.xml
,指定android:targetSdkVersion="15"
并修改project.properities
以定位15
也无济于事。
为了完整起见,这里是我的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>
和我的构建过程
#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"
感谢您的帮助!
答案 0 :(得分:4)
我遇到了同样的问题。这对我有用(注意-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