I create an app and it work on emulator. It works on debug apk on device, but when I build it with generate signed app it doesn't work? what is wrong and how I can debug it on device on signed sate?
Asked
Active
Viewed 873 times
1

Ahmad Aghazadeh
- 16,571
- 12
- 101
- 98

Mojtaba Mojarrad
- 33
- 6
-
You ues ProGuard ? Check -dontwarns . – Ahmad Aghazadeh May 24 '16 at 17:51
-
Yes I use ProGuard. what is -dontwarns? – Mojtaba Mojarrad May 24 '16 at 18:13
-
see this page http://stackoverflow.com/questions/21123835/how-to-use-dontwarn-in-proguard – Ahmad Aghazadeh May 24 '16 at 18:28
-
Thanks, I add used dependency to build by -dontwarms, but problem didn't solved. How can find what dependency create the problem? – Mojtaba Mojarrad May 24 '16 at 21:57
-
Can you tell me which type of functionlity is not working – Umesh Saraswat May 26 '16 at 05:26
-
I don't know what is exactly but I think its related to encrypting or retrofit library! – Mojtaba Mojarrad May 26 '16 at 06:38
3 Answers
2
In my project doesn't run signed app. I changed minifyEnabled value from true to false then problem is solve . this bad solution. I'm looking for a better way.
build.gradle :
buildTypes {
release {
shrinkResources true
minifyEnabled false //true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}

Ahmad Aghazadeh
- 16,571
- 12
- 101
- 98
-
After disable minifyEnabled it's work properly, but I need it in my project – Mojtaba Mojarrad May 26 '16 at 06:39
1
I found the problem and solved it. I must keep models form obfuscating that use retrofit. After use below code my app work properly in minifyEnabled enabled:
-keep com.xxx.xxx.models.** { *; }
retrofit need to know class properties for filling by values.
Thanks every body try to help me.

Mojtaba Mojarrad
- 33
- 6
0
I found progard has problem with retrofit interfce
Sample of interface:
import java.util.List;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
public interface AClient {
// For register device for specific package
@GET("/api/initiate/{packageId}")
Call<InitiateModel> GetInitiateInfo(
@Path("packageId") int packageId
);
}
I add -dontwarn retrofit2.** in progard file. What is wrong?

Mojtaba Mojarrad
- 33
- 6