模拟器或物理设备上的“未安装应用程序”android? [复制]

Posted

技术标签:

【中文标题】模拟器或物理设备上的“未安装应用程序”android? [复制]【英文标题】:"Application not installed" android on emulator or physical device? [duplicate] 【发布时间】:2021-06-22 05:51:53 【问题描述】:

当我在模拟器上运行我的应用程序“RUN”时,它可以工作。但是当我手动安装 APK 时,我收到一条错误消息“未安装应用程序”有什么想法吗?

【问题讨论】:

在安装新apk之前尝试卸载旧apk 这能回答你的问题吗? 'App not Installed' Error on android(可能是任意数量的问题,但可能您安装了以前版本的应用) 【参考方案1】:

禁用 minifyEnable。然后生成构建

 buildTypes 
        release 
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        
    

【讨论】:

这不太可能有帮助。【参考方案2】:

不工作 我的 android studio 4.1.3 颤振 2.0.3

我的毕业典礼

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) 
    localPropertiesFile.withReader('UTF-8')  reader ->
        localProperties.load(reader)
    


def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) 
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")


def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) 
    flutterVersionCode = '7'


def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) 
    flutterVersionName = '1.9.0'


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) 
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))


android 
    compileSdkVersion 28

    sourceSets 
        main.java.srcDirs += 'src/main/kotlin'
    

    lintOptions 
        disable 'InvalidPackage'
        checkReleaseBuilds false //<- add this line
    

    defaultConfig 
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.myorga.myapp"
        minSdkVersion 21
        targetSdkVersion 28
     //   multiDexEnabled true
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    

    signingConfigs 
        release 
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        
    

    buildTypes 
        release 
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `cdcd` works.
//            signingConfig signingConfigs.debug
            signingConfig signingConfigs.release
        
    


flutter 
    source '../..'


dependencies 
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-messaging:20.1.7'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'


apply plugin: 'com.google.gms.google-services'

【讨论】:

嗨,欢迎来到 ***。将来,您可以使用“编辑”功能向原始问题添加更多信息,而不是发布更多信息作为答案。如果所有信息都在您的问题中,它将对每个人都有帮助。祝你好运!

以上是关于模拟器或物理设备上的“未安装应用程序”android? [复制]的主要内容,如果未能解决你的问题,请参考以下文章

iPhone 6 上的模拟器和物理设备之间的差异

在 Windows 上的模拟器和物理设备上运行本机反应的问题

Flutter 应用程序在 android studio 模拟器上完美运行,但不会超过物理设备上的加载屏幕

与 IBAction 链接的 UIButton 不能在物理设备上的模拟中工作,也不能在 Xcode 9.2 中的模拟器中工作

iOS 模拟器或物理设备未收到 FCM 数据消息

如果使用物理设备或 Bluestacks 模拟器,布局显示会非常不同