尝试在物理设备上安装apk时“未指定jdk”

时间:2018-09-18 10:21:10

标签: java android xml android-studio

我正在创建一个android应用程序,直到四天前一切正常,当我试图通过电子邮件向我的朋友发送一个apk(该apk已签名)时。但是apk并没有安装在我朋友的手机上,每次他用来尝试使用android studio通过笔记本电脑安装apk时,都会弹出一个错误,提示“未为应用程序调试指定jdk,安装应用程序时出错”,如果他尝试使用电子邮件直接通过手机安装该应用程序,然后弹出错误消息,提示“解析错误时出现问题”。但是我的应用程序在模拟器和使用USB调试安装的任何设备上均可正常运行。但是,如果我将apk发送到其他任何手机,则会弹出这两个错误。我已经经历了很多有关堆栈溢出的内容,但是似乎没有什么可做的是我的gradle配置,以防万一。

下面是模块级gradle。

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.abc.tbd2"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            aaptOptions.cruncherEnabled = false
            aaptOptions.useNewCruncher = false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc2'
    implementation 'com.android.support:design:28.0.0-rc02'

    implementation 'com.android.support:cardview-v7:28.0.0-rc02'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.android.support:support-v4:28.0.0-rc02'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'

    implementation 'com.google.android.gms:play-services-auth:15.0.1'

    implementation 'com.github.Goodiebag:Pinview:v1.3'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation "android.arch.core:runtime:1.1.1"
    implementation "android.arch.core:common:1.1.1"

    implementation 'com.android.support:exifinterface:28.0.0-rc02'

    //for material dialog
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

    implementation 'com.firebaseui:firebase-ui-database:4.1.0'


    implementation 'br.com.simplepass:loading-button-android:1.7.2'
    //image compression
    implementation 'id.zelory:compressor:2.0.0'
    implementation 'com.github.jgabrielfreitas:BlurImageView:1.0.1'
    //twitter
    implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
    implementation 'com.squareup.okhttp:okhttp:2.5.0'

    implementation 'com.github.mancj:MaterialSearchBar:0.7.6'

    implementation 'com.github.jd-alexander:LikeButton:0.2.3'




}

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

Project Gradle

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://dl.bintray.com/spark/maven'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.1'

    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven{url 'https://jitpack.io'}

        maven {
            url 'https://dl.bintray.com/spark/maven'
        }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

0 个答案:

没有答案