android - 应用程序在模拟器上运行良好,但应用程序无法通过 apk 包安装在移动设备上
问题描述
我使用 android studio 3.6 canary 3 为 android 5.1.1 编写了一个应用程序。移动设备是带有 5.1.1 android stock rom api22 的 samsung xcover 3 (sm-g388f)
在模拟器 5.1.1 api 22 上运行不会在 logcat 中显示任何错误,只是 E/libprocessgroup: failed to make and chown /acct/uid_10058: Read-only file system
应用程序已完成,并且可以在模拟器上完全运行。
构建调试构建类型 apk。我有电话空间。没有开发者游戏商店帐户,现在没有现金。我正在将 apk 压缩到 zip,通过 gmail 发送到手机,下载解压缩并安装。
我尝试了各种编译、构建工具版本。
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.pippboy"
minSdkVersion 22
targetSdkVersion 22
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable = true
}
debug {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
}
Apk 有 1mb。这是我的第一个应用程序。我只想通过从某个主机下载的 apk 包安装在移动设备上。
解决方案
在设备上,您是否设置了安全选项以允许从不受信任的(即不是 Google Play 商店)来源安装 APK?你需要先允许它。您不必这样做,但您可能还希望允许在设备上进行 USB 调试。
推荐阅读
- java - 为什么两个 LocalDate 变量之间的比较不起作用?
- c# - 如何使用反序列化对象 c#
- c - 如何显示C中输入的总和和计算
- charts - 如何在颤动中制作动态图表?
- c# - 根据来自另一个方法的字符串命名 DispatcherTimer?
- python-3.x - pybluez 的一些错误。我无法导入蓝牙
- apache-kafka - 我收到一个错误 Kafka Connect HDFS 连接器并且没有数据写入 HDFS
- gosu - TextInput 框旁边的示例文本
- android - 如何使用 RecyclerView 项填充 AlertDialog
- xml - 处理 XML 文本内容而不包含标记标签