Sentry-java: Android RELEASE build in Windows: os error 123 at Task :app:persistSentryProguardUuidsForReleaseRelease

Created on 17 Jun 2019  Â·  9Comments  Â·  Source: getsentry/sentry-java

I am using io.sentry.android.gradle plugin v.1.7.22 on an ANDROID RELEASE build (no flavours involved)
My sentinel.properties file is in /app module foldere and has:

defaults.project=pocket-nni-sat
defaults.org=all-org-projs
auth.token=XXXXX

I also disabled R8 with

android.enableR8=false

in gradle.properties.
My proguard-rules.pro has:

-keepattributes LineNumberTable,SourceFile
-dontwarn org.slf4j.**
-dontwarn javax.**
-keep class io.sentry.event.Event { *; }

Environment:
Windows 10
Android Studio 3.4.1
Gradle v.5.1.1
Gradle Plugin 3.4.1

I get (I already set SENTRY_LOG_LEVEL= debug with no effect)

> Task :app:persistSentryProguardUuidsForReleaseRelease FAILED
> compressing mappings
error: The filename, directory name, or volume label syntax is incorrect. (os error 123)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:persistSentryProguardUuidsForReleaseRelease'.
> Process 'command 'cmd'' finished with non-zero exit value 1

All 9 comments

Are you using AGP 3.4?
Could it be related to #725?

What is AGP?
How can I test the solution?

On Mon, 17 Jun 2019 at 20:08, Bruno Garcia notifications@github.com wrote:

Are you using AGP 3.4?
Could it be related to #725
https://github.com/getsentry/sentry-java/pull/725?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/getsentry/sentry-java/issues/727?email_source=notifications&email_token=AANEOSQQJKSDP55GUP7A3NTP27HJJA5CNFSM4HYWWJH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX37Z4Q#issuecomment-502791410,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AANEOSWBUEAOIE3YFNYQDBLP27HJJANCNFSM4HYWWJHQ
.

@mcfoi it's published to Maven Central: https://github.com/getsentry/sentry-java/releases/tag/v1.7.23

I confirm release v1.723 fixes the issue "os error 123 at Task :app:persistSentryProguardUuidsForReleaseRelease"..
..despite leaves me with another:

> Task :app:persistSentryProguardUuidsForReleaseRelease FAILED
> compressing mappings
> uploading mappings
error: An organization slug is required (provide with --org)

despite I have in my sentry.properties

defaults.project=pocket-nni-sat
defaults.org=all-org-projs
auth.token=8a..  ...4fdc

that probably means it cannot find my sentry.properties that is in my projectroot/app folder

Should i open another issue?

@mcfoi your sentry.properties file should be in the project root folder, from the doc:

The credentials for the upload step are loaded via environment variables or from a sentry.properties file in your project root.

Can you try moving it to the project root folder please?

I moved sentry.properties to < projectroot > ( was in < projectroot >/app folder) and I confirm now it is working as expectded.

So, to sum it up:

FIRST:
A file named sentry.properties MUST be placed in Android project root, the same containing gradle.properties and local.properties.
NOT in < root >/app or anywhere in some /res folder
Its content must be at least:

defaults.project=project-name
defaults.org=my-org-name
auth.token=8a021.. ...fdc

token can be obtained from https://sentry.io/settings/account/api/auth-tokens/

SECOND
PROGUARD configuration file in < root >/app MUST have following lines or no attempt to upload mappings to Sentry will be performed in Release Gradle Task :app:assembleRelease

-keepattributes LineNumberTable,SourceFile
-dontwarn org.slf4j.**
-dontwarn javax.**
-keep class io.sentry.event.Event { *; }

I moved sentry.properties to < projectroot > ( was in < projectroot >/app folder) and I confirm now it is working as expectded.

Great.

So, to sum it up:

FIRST:
A file named sentry.properties MUST be placed in Android project root, the same containing gradle.properties and local.properties.
NOT in < root >/app or anywhere in some /res folder

Yes, that applies to the sentry.properties which is used for release meta-data upload.
The properties file used to configure the Sentry client must be placed in the app resources (that is clearly stated here).

Its content must be at least:

defaults.project=project-name
defaults.org=my-org-name
auth.token=8a021.. ...fdc

token can be obtained from https://sentry.io/settings/account/api/auth-tokens/

SECOND
PROGUARD configuration file in < root >/app MUST have following lines or no attempt to upload mappings to Sentry will be performed in Release Gradle Task :app:assembleRelease

-keepattributes LineNumberTable,SourceFile
-dontwarn org.slf4j.**
-dontwarn javax.**
-keep class io.sentry.event.Event { *; }

This Proguard configuration file is automatically generated by the Sentry gradle plugin and merged together with your app's configuration, unless you disable automatic proguard configuration with autoProguardConfig.

@bruno-garcia - can we add this to documentation on this page - https://docs.sentry.io/platforms/android?

@bruno-garcia - can we add this to documentation on this page - https://docs.sentry.io/platforms/android?

done

Was this page helpful?
0 / 5 - 0 ratings