-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload_to_play_store
doesn't upload native debug symbols while running on CI
#21064
Comments
+1. Build with CI never get debug symbol uploaded |
Same issue here, I think it's because the zip function add a not wished level lib/ folder and is not valid for the playstore |
yeah that is the issue. |
Is your zip file really structured in the same way as shown bellow?
Try In addition, I found someone who says download artifacts makes artifacts corrupted when you use |
I want to thank you @i10416 for your question, it helped me solve this issue! I solved this with current tools like this on Github Actions running the Fastlane action from my
android Fastfile symbolsFilePath = File.join(
Dir.pwd,
"..",
"native_debug_symbols.zip"
)
symbolsFolderPath = File.join(
Dir.pwd,
"..",
"app",
"build",
"intermediates",
"merged_native_libs",
"release",
"out",
"lib"
)
system("cd #{symbolsFolderPath} && zip -r #{symbolsFilePath} .")
upload_to_play_store(
# ...other options ...
mapping_paths: [mappingFilePath, symbolsFilePath]
) build.gradle android {
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
debuggable false
ndk {
// Note: There is a 300 MB limit for the native debug symbols file.
// If your debug symbols footprint is too large, use SYMBOL_TABLE
// instead of FULL to decrease the file size.
// Ref: https://developer.android.com/build/shrink-code#native-crash-support
debugSymbolLevel 'FULL'
}
}
}
} Notes: |
Alternative approach:We can create a zip file containing the contents of the "lib" folder using GitHub actions. Afterwards, we can share the file path of the zip with Fastlane. - name: 📂 Create a zip file for Native Symbols.
shell: bash
run: |
cd android/app/build/intermediates/merged_native_libs/ReleaseNativeLibs/out/lib/
zip -r symbols.zip *
echo "symbol_file_path=android/app/build/intermediates/merged_native_libs/ReleaseNativeLibs/out/lib/symbols.zip" >> "$GITHUB_ENV"
echo "mapping_file_path=android/app/build/outputs/mapping/Release/mapping.txt" >> "$GITHUB_ENV" It creates a zip file named "symbols.zip" that contains the contents of the directory. upload_to_play_store(
json_key: service_cred_file_path,
package_name: ruc__app_package_id,
aab: apk_path,
track:'internal',
mapping_paths: [symbol_file_path, mapping_file_path],
release_status:'completed'
) |
@StefanWallin I still get the error after following exactly your code. I run it locally
But when I zip it manually (right click and compress them), the upload process worked 🤔 |
@Dat-Mobile so when you zip meaning when you unzip that file do you end up with |
I created a local fastlane plugin. The class NdkZipAction < Action
def self.run(params)
output_path = File.expand_path(params[:output_path] || params[:ndb_path])
ndb_path = params[:ndb_path]
verbose = params[:verbose]
output_path += ".zip" unless output_path.end_with?(".zip")
UI.message("Compressing native debug symbols in #{ndb_path}...")
output_dir = File.expand_path("..", output_path)
FileUtils.mkdir_p(output_dir)
# no trailing /
ndb_path = ndb_path == '/' ? ndb_path : ndb_path.chomp(?/)
# traverse the "out" directory
ndb_path = ndb_path + '/out' if Dir.exist? ndb_path + '/out'
# the "lib" directory must not be included for the ndk stuff
ndb_path = ndb_path + '/lib' if Dir.exist? ndb_path + '/lib'
Dir.chdir(ndb_path) do
zip_command = ["zip", verbose ? "-r" : "-rq", output_path, "."]
Actions.sh(*zip_command)
end
UI.success("Successfully generated zip file at path '#{output_path}'")
output_path
end
# .. rest of ndk_zip_action.rb etc |
New Issue Checklist
Issue Description
I'm trying to upload Native debug symbols to playstore.
Approach 1st using
mapping_paths
Initially I tried zipping debug symbols and passed them to
mapping_paths
like this :but it resulted to an error
but zipping debug symbols and uploading them manually works fine. 👍
Approach 2nd using
debugSymbolLevel 'FULL'
According to android docs
I updated my app's
build.gradle
file accordinglyRan fastlane in Github actions, bundle uploaded successfully with mappings file but no native symbols 😕
Ran fastlane locally and I can see native debug symbols and mappings attached to the file
I'm not sure if I'm missing anything.
Command executed
bundle exec fastlane android deploy_stage_internal --env staging
Environment
The text was updated successfully, but these errors were encountered: