gpt4 book ai didi

cordova - Ionic android build 生成未签名的 apk,但不要安装在我的 android 8.1.0 中

转载 作者:行者123 更新时间:2023-12-01 01:42:13 71 4
gpt4 key购买 nike

当我提供 ionic 应用程序时,它可以在浏览器中运行,但用于 android 的构建 apk 不起作用。 apk 无法安装。
我试过 ionic cordova build android --release
带有以下消息的构建通过

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\ruban\AppData\Local\Android\Sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preReleaseBuild UP-TO-DATE
> Task :CordovaLib:checkReleaseManifest UP-TO-DATE
> Task :CordovaLib:processReleaseManifest UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE`
D:\myApp\platforms\android\app\src\main\res\drawable-land-hdpi\screen.png: Error: The drawable "screen" in drawable-land-hdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-land-ldpi\screen.png: Error: The drawable "screen" in drawable-land-ldpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-land-mdpi\screen.png: Error: The drawable "screen" in drawable-land-mdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-land-xhdpi\screen.png: Error: The drawable "screen" in drawable-land-xhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-land-xxhdpi\screen.png: Error: The drawable "screen" in drawable-land-xxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png: Error: The drawable "screen" in drawable-land-xxxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-port-hdpi\screen.png: Error: The drawable "screen" in drawable-port-hdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-port-ldpi\screen.png: Error: The drawable "screen" in drawable-port-ldpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-port-mdpi\screen.png: Error: The drawable "screen" in drawable-port-mdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-port-xhdpi\screen.png: Error: The drawable "screen" in drawable-port-xhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-port-xxhdpi\screen.png: Error: The drawable "screen" in drawable-port-xxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\myApp\platforms\android\app\src\main\res\drawable-port-xxxhdpi\screen.png: Error: The drawable "screen" in drawable-port-xxxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
该构建会创建未在我的 android 设备上安装的未签名 apk 文件。
ionic 信息命令显示以下消息
ionic :
   ionic (Ionic CLI)             : 4.12.0 (C:\Users\ruban\AppData\Roaming\nvm\v10.15.3\node_modules\ionic)
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/build-angular : 0.13.7
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.7
@ionic/angular-toolkit : 1.4.1
Cordova :
   cordova (Cordova CLI) : 9.0.0
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
系统:
   Android SDK Tools : 26.1.1 (C:\Users\ruban\AppData\Local\Android\Sdk)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

最佳答案

您不需要修复任何内容,因为这不是错误。
但如果你想修复它......

如果你不喜欢这个提醒,
您应该将下一行添加到 config.xml 文件中

<splash density="ldpi" src="resources/android/splash/drawable-ldpi-screen.png" />
<splash density="mdpi" src="resources/android/splash/drawable-mdpi-screen.png" />
<splash density="hdpi" src="resources/android/splash/drawable-hdpi-screen.png" />
<splash density="xhdpi" src="resources/android/splash/drawable-xhdpi-screen.png" />
<splash density="xxhdpi" src="resources/android/splash/drawable-xxhdpi-screen.png" />
<splash density="xxxhdpi" src="resources/android/splash/drawable-xxxhdpi-screen.png" />

资源可以是 drawable-xxxhdpi-screen ... 或者你可以使用 port 或 land。

使用下一行,您应该能够生成 key 以对其进行签名

keytool -genkey -v -keystore ejemplo.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

使用下一行,您将能够对您的应用进行签名

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ejemplo.keystore app-release-unsigned.apk alias_name

有了这个,你签署了 apk,你就可以在 Android 中安装该应用程序。

这对我有用。

关于cordova - Ionic android build 生成未签名的 apk,但不要安装在我的 android 8.1.0 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55449544/

71 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com