gpt4 book ai didi

android - 与好友共享apk时,应用无法运行

转载 作者:行者123 更新时间:2023-12-03 06:32:15 26 4
gpt4 key购买 nike

当我使用USB电缆连接模拟器时,甚至在设备上,我的Android应用程序都可以正常运行。但是,当我生成apk文件并与他人共享时,该应用程序将无法运行。启动屏幕启动后崩溃。

这是我的app / build.gradle:

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId 'com.test'
minSdkVersion 15
targetSdkVersion 22
versionCode 2
versionName "1.1"

multiDexEnabled true

def serverPropertiesFile = rootProject.file("server.properties")

// Initialize a new Properties() object called keystoreProperties.
def serverProperties = new Properties()

// Load your keystore.properties file into the serverProperties object.
serverProperties.load(new FileInputStream(serverPropertiesFile))


buildConfigField("String", "HOST", serverProperties['SERVER_URL'])
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
productFlavors {
}
lintOptions {
abortOnError false
} } dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'com.daimajia.androidanimations:library:1.1.2@aar'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

Manifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

有什么帮助吗?

最佳答案

我认为您缺少API 23或更高版本的运行时权限

尝试为摄像头,位置和电话授予运行时权限。以下是添加运行时权限的示例。

https://developer.android.com/training/permissions/requesting.html

How to check Grants Permissions at Run-Time?

https://www.androidhive.info/2016/11/android-working-marshmallow-m-runtime-permissions/

要检查是否缺少运行时权限是问题,请转到“电话Settings-> Apps-> Installed App-> Your App-> Permissions-> Allow Permissions

关于android - 与好友共享apk时,应用无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47363202/

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