English 中文(简体)
瞄准R+(转化30及以上)需要资源。 a. 安装的APK器,储存在4个逐个边界上
原标题:Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary

我正试图从29到30年更新和淡化目标。 我已更新:

compileSdkVersion           = 30
targetSdkVersion            = 30
buildToolsVersion           = "30.0.2"

该表与<条码>星-p-f-v 4一致,然后按正式文件签字。

When I try to adb install the .apk however I get:

Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary]

是否有人取得了任何成功?

问题回答

如果你要说话,然后用老版<代码>jarsigner签署。 那么,在签署时,它就会毫不动摇。

确保使用新的<代码>apksigner。 在我的系统中,该编码载于~/Android/Sdk/build-tools/32.0.0/apksigner

Here is my repack-n-sign script. Note that you may need to update your BUILD_TOOLS path and set it to the right location:

#!/bin/sh

BUILD_TOOLS=~/Android/Sdk/build-tools/32.0.0/

if [ -z "$1" ]; then
        echo "usage: $0 your-app.apk"
        exit 1
fi

DIR=`mktemp -d`
DN=`dirname "$1"`
BN=`basename "$1"`
OUT="$DN/repacked-$BN"
OUT_ALIGNED="$DN/aligned-$BN"
OUT_SIGNED="$DN/signed-$BN"

# Debug mode
set -x

# Repack without the META-INF in case it was already signed
# and flag resources.arsc as no-compress:
unzip -q "$1" -d "$DIR"
pushd .
cd $DIR

rm -rf "$DIR/META-INF"
zip -n "resources.arsc" -r ../repacked.$$.apk *

popd

mv "$DIR/../repacked.$$.apk" "$OUT"

# Align
rm -f "$OUT_ALIGNED"
"$BUILD_TOOLS"/zipalign -p -v 4 "$OUT" "$OUT_ALIGNED"

# Verify
"$BUILD_TOOLS"/zipalign -vc 4 "$OUT_ALIGNED"

# Sign
"$BUILD_TOOLS"/apksigner sign -verbose -ks ~/my-release-key.keystore --out "$OUT_SIGNED" "$OUT_ALIGNED"

# Cleanup
rm -rf "$DIR"

echo == Done: $OUT_ALIGNED

这是由于棘手的问题。

在签字方之前使用以下指挥器

页: 1 (如果核查失败)

步骤2:zipalign -p -f -v 4 firstzipration.apk final.apk (verification will adopt)

使用<代码>final.apk签署申请。 Refer to zipalign documentation





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签