@@ -57,13 +57,58 @@ platform :android do
5757 lane :distribute_to_s3 do |options |
5858 build_apk
5959
60- # Extract bucket name and path from env variable
60+ # Add logging to verify APK file availability
61+ UI . message ( "🔍 Checking APK build outputs..." )
62+
63+ # List contents of the build directory
64+ build_dir = "#{ root_path } /build/app/outputs"
65+ if Dir . exist? ( build_dir )
66+ UI . message ( "📁 Contents of #{ build_dir } :" )
67+ Dir . glob ( "#{ build_dir } /**/*" ) . each do |file |
68+ UI . message ( " - #{ file } " )
69+ end
70+ else
71+ UI . error ( "❌ Build directory does not exist: #{ build_dir } " )
72+ end
73+
74+ # Check specific APK locations
75+ expected_apk = "#{ root_path } /build/app/outputs/apk/release/flutter-sample-app.apk"
76+ actual_apk = "#{ root_path } /build/app/outputs/flutter-apk/app-release.apk"
77+
78+ UI . message ( "🎯 Checking expected APK location: #{ expected_apk } " )
79+ if File . exist? ( expected_apk )
80+ UI . success ( "✅ Expected APK found!" )
81+ file_size = File . size ( expected_apk ) / ( 1024 * 1024 ) # Size in MB
82+ UI . message ( "📦 APK size: #{ file_size . round ( 1 ) } MB" )
83+ else
84+ UI . error ( "❌ Expected APK not found" )
85+ end
86+
87+ UI . message ( "🎯 Checking actual APK location: #{ actual_apk } " )
88+ if File . exist? ( actual_apk )
89+ UI . success ( "✅ Actual APK found!" )
90+ file_size = File . size ( actual_apk ) / ( 1024 * 1024 ) # Size in MB
91+ UI . message ( "📦 APK size: #{ file_size . round ( 1 ) } MB" )
92+ else
93+ UI . error ( "❌ Actual APK not found" )
94+ end
95+
96+ # Find all APK files
97+ UI . message ( "🔎 Searching for all APK files in build directory..." )
98+ apk_files = Dir . glob ( "#{ build_dir } /**/*.apk" )
99+ if apk_files . any?
100+ UI . message ( "📱 Found APK files:" )
101+ apk_files . each do |apk |
102+ file_size = File . size ( apk ) / ( 1024 * 1024 ) # Size in MB
103+ UI . message ( " - #{ apk } (#{ file_size . round ( 1 ) } MB)" )
104+ end
105+ else
106+ UI . error ( "❌ No APK files found in build directory!" )
107+ end
108+
61109 bucket_with_path = ENV . fetch ( "AWS_S3_BUCKET" )
62110 bucket_name , path = bucket_with_path . split ( '/' , 2 )
63111
64- # Validate that we have both bucket and path
65- UI . user_error! ( "AWS_S3_BUCKET must include path (e.g., 'bucket-name/downloads')" ) if path . nil? || path . empty?
66-
67112 aws_s3 (
68113 access_key : ENV . fetch ( "AWS_ACCESS_KEY_ID" ) ,
69114 secret_access_key : ENV . fetch ( "AWS_SECRET_ACCESS_KEY" ) ,
0 commit comments