in the version 0.4.2 i write in the AndroidManifest
android:debuggable="false" to upload to play.store
but in the 0.5.1, i do not what to do.
Please, help me.
y resolved my problem with
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
foo{
debuggable false //add this
}
}
in the androidmanifest
i resolved the problem with
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
foo{
debuggable false //add this
}
}
Related
We have enabled R8 in Gradle properties and when we set minify enable to true the app gets crashed stating the below exception code.
In gradle.properties,
android.enableR8 = true
android.enableR8.fullMode=true
useProguard = true
In build.gradle,
buildTypes {
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug{
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Exception : java.lang.SecurityException: Specified package com.oplus.internal.telephony under uid 1001 but it is not
at com.android.server.appop.AppOpsService.verifyAndGetBypass(AppOpsService.java:4791)
at com.android.server.appop.AppOpsService.noteOperationUnchecked(AppOpsService.java:3575)
at com.android.server.appop.AppOpsService.noteOperationImpl(AppOpsService.java:3563)
at com.android.server.appop.AppOpsService.access$4000(AppOpsService.java:223)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.lambda$noteOperation$4(AppOpsService.java:7769)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher$$ExternalSyntheticLambda5.apply(Unknown Source:33)
at com.android.server.policy.AppOpsPolicy.noteOperation(AppOpsPolicy.java:221)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.noteOperation(AppOpsService.java:7767)
at com.android.server.appop.AppOpsService.noteOperation(AppOpsService.java:3547)
at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:476)
at com.android.server.appop.OplusAppOpsService.onTransact(OplusAppOpsService.java:38)
at android.os.Binder.execTransactInternal(Binder.java:1226)
at android.os.Binder.execTransact(Binder.java:1163)
flavorDimensions 'publish', 'develop'
productFlavors {
live {
dimension 'publish'
}
dev {
dimension 'develop'
applicationIdSuffix ".dev"
}
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
zipAlignEnabled true
debuggable true
productFlavors.live.signingConfig buildSignConfig.debug
productFlavors.dev.signingConfig buildSignConfig.debug
}
release {
minifyEnabled true
shrinkResources true
zipAlignEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
productFlavors.live.signingConfig buildSignConfig.release
productFlavors.dev.signingConfig buildSignConfig.release
}
}
I have 2 library modules and in application gradle file, I have above flavorDomensions, productFlavors and buildTypes. This produces build variant incorrectly like liveDevDedug and liveDevRelease. What could be the possible errors? Using AS 3.0
Proguard is working well for release version but it is not work for debug version.
Here is my build.gradle file
buildTypes {
debug {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
I'm using TeamCity to build version of application and upload it to HockeyApp. I want to enable proguard only on specific flavor and when building is on teamcity and uploading on HockeyApp, is it possible? Right now I defined variable in gradle file:
def runProguard = false
and set it in my flavors to false or true and then in build type I have:
if (project.hasProperty('teamcity') && runProguard.toBoolean()) {
minifyEnabled true
} else {
minifyEnabled false
}
but it doesn't work on teamcity and I have version without proguard on HockeyApp. How to fix it? Is it another way to do it for example defining gradle task with enabled proguard?
You should do something like this to achieve what you want:
android {
buildTypes {
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
mock {
initWith(buildTypes.release)
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
pro {
applicationId = 'com.example.app.pro'
}
free {
applicationId = 'com.example.app.free'
}
}
Also you can set some environment variable in teamcity and check if the build is happening on ci or it's on local machine:
if (!System.getenv("CI")) {
//do something on local machine
} else {
// do something on ci server
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Just update your buildTypes instead your .
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Then Clean - Rebuild And
File -> Invalidate Cache / Restart . I hope it will helps you .
FYI : I think your gradle file under " apply plugin: 'com.android.application'"
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
OR
You can try File -> Invalidate Caches/Restart, and select this option to fix this.