I want to upload an Android app with debug symbols to Google Play Console in order to have detailed crash logs for my C++ code.
So I followed the steps here and added this line:
android.buildTypes.release.ndk.debugSymbolLevel = 'FULL'
At the top of my Gradle file just below the 'apply plugin:' lines (in the Gradle at :app level)
I also tried to add:
ndk {
debugSymbolLevel 'FULL'
}
in: buildTypes { release{ here!!! }}
but doesn't work.
I still get the following message in the Google Play Console when I upload my app:
This App Bundle contains native code, and you've not uploaded debug
symbols. We recommend you upload a symbol file to make your crashes
and ANRs easier to analyze and debug.
The problem is mentioned here but not solved.
Anybody found a workaround?
Thanks.
In my case my build.gradle script already had a buildTypes block and in that block I could set up the ndk.debugSymbolLevel config option, an image say more than thousand words, hope it can help you
image of my build.gradle script
Related
I'd like to deactivate signature V2 of gradle in Unity for uploading my apk file to Oculus dashboard.
Unity may build apk files according to mainTemplate.gradle and generates build.gradle.
I added following texts to mainTemplate.gradle.
signingConfigs {
release {
v1SigningEnabled true
v2SigningEnabled false
}
}
Unity builder, however, activates signature V2 during building and overrides signing settings.
build.gradle shows signature V2 activation (Please see an attached image).
Left:mainTemplate.gradle, Right:build.gradle
How do I edit the signature settings?
Thank you for replying.
Finally I re-sign my apk file with apksigner.
apksigner sign --ks <keystore> --ks-key-alias <alias name> --v2-signing-enabled false --v3-signing-enabled false --out <output name> <re-signed apk file>
Open the Oculus Folder.
Click on the settings file just inside.
Look at the Inspector, make sure GO/GearVR is checked.
Problem solved.
I think there may be a commented line at the top of the mainTemplate.gradle that needs to be removed before it will actually use the mainTemplate.gradle changes
Someone else suggests doing it like this if that is not the issue, and it potentially could be an ordering issue.
**SIGN**
// Add this block just below **SIGN**
signingConfigs {
release {
v1SigningEnabled true
v2SigningEnabled false
}
}
Source: https://forums.oculusvr.com/developer/discussion/73099/apk-is-signed-with-signature-scheme-v3
Might also want to try removing **SIGN** and **SIGN_CONFIG** if they exist and manually set those values in the file instead of using Unity and see if it starts using your changes
Alternatively, I have used jarsigner (or the replacement, apksigner) externally after creating a build alongside zipalign, which is not as optimal as editing the gradle is, but allows for editing the build with scripts using APKtool if needed. The APK should not signed with a release key at all in Unity. Doing so before doing this may cause the APK to not be installable. There is a more in depth video of this in the link provided above.
https://developer.android.com/studio/command-line/apksigner
While generating release in android studio Build--> Generating signed Bundle/APK(s), I got below message
"Lint found fatal errors while assembling a release target", because of this I am unable to generate the release build
Try this:
lintOptions {
checkReleaseBuilds false
}
to app level build.grade file within the android{ } section.
In your Android Studio, switch to the Project pane. Go app --> build
--> reports --> lint-results-prodRelease-fatal.xml
Here android studio will open the file explaining the error, message, and the place and line number where it has occurred.
Now in 2022, the path to lint output might be changed. please check in For me I found the error mentioned in this path
app\build\intermediates\lint_vital_intermediate_text_report\release\lint-results-release.txt
a work around but will not solve the real problem and you might face troubles in production is to change below true to false. but I don't recommend it.
android {
lintOptions {
checkReleaseBuilds true
abortOnError true
}
After setting up the Sentry.io error tracking I get this error when I try to Generate Signed Apk:
Java Compiler
error: An organization slug is required (provide with --org)
Click on this image and open it to see more details:
I cannot understand anything from this one:
Process 'command
'/var/folders/j4/_fzm1rks3tsc2h3j4l2qbq4w0000gn/T/.sentry-cli1369818638611304938.exe'
' finished with non-zero exit value 1
This is the file address that was raised in error:
How can I solve this problem and Generate Signed Apk?
The docs are not a bit clear, though its mentioned but easy to miss it. There are two different sentry.properties required here.
Please note the sentry.properties in your project root that configures sentry-cli is different than the one you include in your application resources to configure the Sentry SDK at runtime (as seen in the configuration documentation).
You need to have another sentry.properties file in the project root with
defaults.project=your-project
defaults.org=your-org
auth.token=YOUR_AUTH_TOKEN
and the runtime sentry.properties with DSN values, etc can be placed in app/src/main/resources directory(create resource directory if required)
Config Docs
You need to upload the Proguard mapping file to the sentry server.
create a file in the root project folder and set name sentry.properties.
defaults.url=https://sentry.io
defaults.org=TEST
defaults.project=TEST_DEV
auth.token=TOKEN
replace TEST, TEST_DEV, and TOKEN.
you can get TOKEN from https://sentry.io/api
if you are use custom sentry server, replace https://sentry.io to your server adddress.
and change file build.gradle
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'io.sentry:sentry-android-gradle-plugin:1.7.27'
}
}
and
apply plugin: 'com.android.application'
apply plugin: 'io.sentry.android.gradle'
...
sentry {
autoProguardConfig true
autoUpload true
}
android {
...
}
dependencies {
...
implementation 'io.sentry:sentry-android:1.7.27'
implementation 'org.slf4j:slf4j-nop:1.7.25'
...
}
When you enable Proguard minification, symbols are uploaded to Sentry.
This upload is done via the sentry-cli, which is throwing the error. The error says the CLI doesn't know which project within Sentry to associate your symbols with.
You need to make sure to go through the gradle integration in the docs.
Specifically:
defaults.project=airflow
defaults.org=sentry
auth.token=YOUR_AUTH_TOKEN
Alternatively you can use sentry-cli directly to upload symbols, although the gradle integration is advised.
For ReactNative/iOS, if you have such errors check that you put sentry.properties file in iOS folder
I also stranded here whilst trying to figure what was going wrong with my sentry source map uploads (not on android, but for web with a similar error). To debug my events that weren't matched, I was using the sentry-cli like so;
So I was searching how I could add the organization slug to my source map uploads. But this error wasn't about the event, but for using the explain CLI functionality itself!!! Which confused me.
I had to pass additional parameters to the CLI script to get the actual problem with the event;
Maybe this will help someone else who also skipped over the docs 😅
instead of making
minifyEnabled false
Just add these rules to proguard rules file and keep minifyEnabled true
#sentry
-keepattributes LineNumberTable,SourceFile
-dontwarn org.slf4j.**
-dontwarn javax.**
-keep class io.sentry.event.Event { *; }
That solved my issue without disabling minification
IT IS NOT A REAL ANSWER But it can solve our problem in the short term by setting false value to minifyEnabled.
app/build.gradle:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
but it added 1.3MB to the size my of Apk file.
Please let me know if anyone has a different better solution.
I got problem when change name packages in android studio,
first i use some open source project, then when i want to change the previous packages some of function cant be used, the error message is "ClassNotFoundException:yuku.kpri.model.Song" even thoughni already change packages "yuku" to "buna" and all packages that related to "yuku" change to "buna" and also packages "yuku.kpri.model.Song" changes to "buna.kpri.model.Song" but the code still run to yuku.kpri.model.Song,
I already try many solution like
Close/Unselect Compact Empty Middle Packages ,Then right click your package and rename it. Here
Clean Project
Rebuild Project
change the applicationId Here
Error Message when try to use the function
Here
Help me to solve this problem, what i miss and my mistake...
im looking for your answer
One thing you could try is selecting File --> Invalidate Caches/Restart, sometimes it works magic.
This could be a Proguard issue.
Try to set "minifyEnabled false" for both Release & Debug build types in your projects build.gradle file :
buildTypes {
debug {
minifyEnabled false
}
release {
minifyEnabled false
}
}
If this works, you should exclude the class in the proguard-ruls.pro file.
I'd like to use crashlytics in our app, but I'm not allowed to upload it's proguard mapping file anywhere to the outside world (company policy). Is it possible to use Crashlytics but with obfuscated stacktraces?
In io.fabric plugin's docs I've found this option:
ext.enableCrashlytics = false
But it disables whole reporting, so that's not what I want.
I have added this at the end of app gradle file:
tasks.whenTaskAdded {task ->
if(task.name.toLowerCase().contains("crashlytics")) {
task.enabled = false
}
}
Build log:
> Task :app:crashlyticsStoreDeobsDebug SKIPPED
> Task :app:crashlyticsUploadDeobsDebug SKIPPED
Please note that this disables all crashlytics related tasks. Uploading proguard mapping file by default is some kind of misunderstanding. It is like uploading private key and its password. This file should only be stored in your vault. So I guess it is better to completely disable all their task by default :)
I am just wondering why this is not a big issue for developers.
They have everything planned ! ;-) According to this link : "Crashlytics automatically de-obfuscates stack traces for your reports", so you shouldn't have to worry about it.
Simply obfuscate your app with ProGuard, don't forget to update ProGuard rules to avoid unexpected crashes with release app, and it should be ok !
(help page is about Eclipse, but I used Crashlytics with Android Studio just some days ago, and it works fine too)
EDIT 1 : and according to the very end of this second link, Crashlytics automatically upload mapping file during build. It seems you aren't able to disable this.
EDIT 2 : maybe if you use Ant, you would be able to customize (at least a bit) build rules, thanks to crashlytics_build.xml and crashlytics_build_base.xml files. But I'm not used to Ant, and even there, when I read file, it seems the "mapping files auto upload" can't be disabled. :-/
try disable task 'crashlyticsUploadDeobs':
afterEvaluate {
for (Task task : project.tasks.matching { it.name.startsWith('crashlyticsUploadDeobs') }) {
task.enabled = false
}}
Add to app build Gradle file
firebaseCrashlytics {
mappingFileUploadEnabled false
}
https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=android
if you does not have internet connect at that time what will happened mapping will upload to crashlytics or not.