簡體   English   中英

與back4app一起使用時,已簽名的APK與Android Studio版本的行為不同,並已在Google Play上發布。 如何解決?

[英]Signed APK behaving diffently from Android Studio build while working with back4app and released on google play. How to fix it?

2016年,我發布了一個使用parse(和parse.com)存儲一些數據的應用程序,它運行得非常好。 我在Google Play上發布了該軟件,下載量接近5,000。 2017年parse.com被關閉。 我沒有時間轉移到另一台服務器,所以我未從Google Play上發布它。 現在,我想在2018年將其重新上線。 我發現back4app.com正在使用解析API。 我花了幾周的時間更新代碼,現在當我在Android Studio上運行它並將其安裝在手機上時,它可以正常工作。 但是,昨天我在Google Play上發布了Beta版,我的一些朋友說它無法正常運行。 我在手機上檢查了一下,發現,當我直接從Google Play安裝它時,back4app連接不起作用。

有沒有解決的辦法? 它與權限有關嗎? 我不明白的是為什么當android studio安裝它時,它在我的手機中能正常工作,而直接從Google Play安裝時,它卻無法與服務器通信。

在下面,我附上我的畢業證書,希望這里有問題。

 apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion '25.0.3' defaultConfig { applicationId "package.name" minSdkVersion 21 targetSdkVersion 26 multiDexEnabled true versionCode 13 versionName "1.9.2" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dexOptions { // Prevent OutOfMemory with MultiDex during the build phase javaMaxHeapSize "2048" } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) // Fancy Button compile 'com.android.support:appcompat-v7:26.0.0' compile 'info.hoang8f:fbutton:1.0.5' // Parse // Compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.16.3' //update version to the latest one compile fileTree(dir: 'libs', include: 'Parse-*.jar') // AdBuddiz compile 'com.purplebrain.adbuddiz.sdk:AdBuddiz-Java:3.+' // Push compile 'com.parse.bolts:bolts-android:1.+' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1' // Pushes Firebase service apply plugin: 'com.google.gms.google-services' } repositories { maven { url 'http://repository.adbuddiz.com/maven' } maven { url "http://maven.google.com" } jcenter() } 

經過幾個小時的測試,我的代碼終於找到了我的錯誤。

我錯誤地將同一解析庫添加了三遍,其中兩遍已過時,另一遍是正確的。 見下文:

 dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) <- HERE // Fancy Button compile 'com.android.support:appcompat-v7:26.0.0' compile 'info.hoang8f:fbutton:1.0.5' // Parse // Compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.16.3' //update version to the latest one <- THIS IS THE ONLY ONE I NEED! compile fileTree(dir: 'libs', include: 'Parse-*.jar') <- HERE // AdBuddiz compile 'com.purplebrain.adbuddiz.sdk:AdBuddiz-Java:3.+' // Push compile 'com.parse.bolts:bolts-android:1.+' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1' // Pushes Firebase service apply plugin: 'com.google.gms.google-services' } 

所以我要做的就是刪除這兩個並保留正確的一個。

 dependencies { // Fancy Button compile 'com.android.support:appcompat-v7:26.0.0' compile 'info.hoang8f:fbutton:1.0.5' // Parse // Compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.16.3' //update version to the latest one <- THIS IS THE ONLY ONE I NEED! // AdBuddiz compile 'com.purplebrain.adbuddiz.sdk:AdBuddiz-Java:3.+' // Push compile 'com.parse.bolts:bolts-android:1.+' compile 'com.google.firebase:firebase-core:10.0.1' compile 'com.google.firebase:firebase-messaging:10.0.1' // Pushes Firebase service apply plugin: 'com.google.gms.google-services' } 

我幾乎刪除了這個問題,但是我相信將其留在這里告訴我們有時確實很容易解決一個大問題。 您需要做的就是多注意代碼= /我的糟糕!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM