问题描述
我在为 4.1.1 Android 平板电脑部署我的应用程序时遇到了一个大问题.它适用于 4.4.2./4.3.2.手机或使用 Meteor 运行 android-device
.但是,当构建用于生产的包时,它会失败并显示 error -103
(通过 logcat 找到).
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).
由于它在较新的 Droid 上运行,因此问题不在于签名密钥或应用程序.我读到您必须手动 meteor configure-android
,删除 AVD 并使用所需的 droid 版本创建一个新的,这根本没有帮助.
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.
修改AndroidManifest.xml
,指定android:targetSdkVersion="15"
并将project.properities
修改为15
代码> 也没有帮助.
Modifying AndroidManifest.xml
, specifying android:targetSdkVersion="15"
and modifying project.properities
to target 15
did not help either.
为了完整起见,这里是我的 AndoridManifest.xml
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>
和我的构建过程
#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"
感谢您的帮助!
推荐答案
我遇到了同样的问题.这是对我有用的方法(注意 -sigalc MD5withRSA
的规范):
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
这篇关于Meteor Android 应用程序无法安装在 4.1.1 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!