应用程式可在模拟器上正常运作,但无法透过APK套件安装在行动装置上

时间:2019-06-17 15:53:59

标签: android gradle

我使用android studio 3.6 canary 3为android 5.1.1编写了一个应用程序。 Mobile是具有5.1.1 android stock rom api22的三星xcover 3(sm-g388f)

在模拟器5.1.1 api 22上运行仅在logcat中不显示任何错误 E / libprocessgroup:无法制作和添加/ acct / uid_10058:只读文件系统

App已完成,并且可以在模拟器上完全正常工作。

构建调试构建类型apk。 我在电话上有空位。 没有开发者商店帐户,现在没有现金。 我将apk压缩为zip,通过gmail发送至手机,下载解压缩并安装。

我尝试了各种编译buildtools版本。

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软件包安装在移动设备上。

1 个答案:

答案 0 :(得分:0)

您在设备上是否设置了“安全性”选项,以允许从不受信任的源(即不是Google Play商店)安装APK?您需要先允许它。您不必这样做,但您可能还希望允许在设备上进行USB调试。