diff --git a/app-release-signed.apk b/app-release-signed.apk index 6a0b469..d8fc4ef 100644 Binary files a/app-release-signed.apk and b/app-release-signed.apk differ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 31b2915..6732d49 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,4 @@ - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -91,5 +90,10 @@ dependencies { implementation("com.google.ai.client.generativeai:generativeai:0.9.0") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0") -} + // MediaPipe GenAI for offline inference (LLM) + implementation("com.google.mediapipe:tasks-genai:0.10.20") + + // Camera Core to potentially fix missing JNI lib issue + implementation("androidx.camera:camera-core:1.4.0") +} diff --git a/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt b/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt index cc9628b..99070a0 100644 --- a/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt +++ b/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt @@ -17,7 +17,13 @@ enum class ApiProvider { CEREBRAS } -enum class ModelOption(val displayName: String, val modelName: String, val apiProvider: ApiProvider = ApiProvider.GOOGLE) { +enum class ModelOption( + val displayName: String, + val modelName: String, + val apiProvider: ApiProvider = ApiProvider.GOOGLE, + val downloadUrl: String? = null, + val size: String? = null +) { GPT_5_1_CODEX_MAX("GPT-5.1 Codex Max (Vercel)", "openai/gpt-5.1-codex-max", ApiProvider.VERCEL), GPT_5_1_CODEX_MINI("GPT-5.1 Codex Mini (Vercel)", "openai/gpt-5.1-codex-mini", ApiProvider.VERCEL), GPT_5_NANO("GPT-5 Nano (Vercel)", "openai/gpt-5-nano", ApiProvider.VERCEL), @@ -30,7 +36,13 @@ enum class ModelOption(val displayName: String, val modelName: String, val apiPr GEMINI_FLASH("Gemini 2.0 Flash", "gemini-2.0-flash"), GEMINI_FLASH_LITE("Gemini 2.0 Flash Lite", "gemini-2.0-flash-lite"), GEMMA_3_27B_IT("Gemma 3 27B IT", "gemma-3-27b-it"), - GEMMA_3N_E4B_IT("Gemma 3n E4B it (online)", "gemma-3n-e4b-it") + GEMMA_3N_E4B_IT( + "Gemma 3n E4B it (offline)", + "gemma-3n-e4b-it", + ApiProvider.GOOGLE, + "https://huggingface.co/na5h13/gemma-3n-E4B-it-litert-lm/resolve/main/gemma-3n-E4B-it-int4.litertlm?download=true", + "4.92 GB" + ) } val GenerativeViewModelFactory = object : ViewModelProvider.Factory { @@ -73,6 +85,7 @@ val GenerativeViewModelFactory = object : ViewModelProvider.Factory { ) val viewModel = PhotoReasoningViewModel( + application, fallbackModel, currentModel.modelName, liveApiManager @@ -88,6 +101,7 @@ val GenerativeViewModelFactory = object : ViewModelProvider.Factory { generationConfig = config ) PhotoReasoningViewModel( + application, generativeModel, currentModel.modelName, null // No LiveApiManager for regular models diff --git a/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt b/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt index 9d77d78..d3ce646 100644 --- a/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt +++ b/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt @@ -381,12 +381,8 @@ class MainActivity : ComponentActivity() { apiKeyManager = ApiKeyManager.getInstance(this) Log.d(TAG, "onCreate: ApiKeyManager initialized.") - if (apiKeyManager.getApiKeys(ApiProvider.GOOGLE).isEmpty() && apiKeyManager.getApiKeys(ApiProvider.CEREBRAS).isEmpty()) { - showApiKeyDialog = true - Log.d(TAG, "onCreate: No API key found, showApiKeyDialog set to true.") - } else { - Log.d(TAG, "onCreate: API key found.") - } + // API key dialog logic removed from onCreate as requested. + // It will be triggered when needed (e.g., when the user tries to use an online model). // Log.d(TAG, "onCreate: Calling checkAndRequestPermissions.") // Deleted // checkAndRequestPermissions() // Deleted diff --git a/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt b/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt index d31154e..507eaba 100644 --- a/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt +++ b/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt @@ -41,6 +41,10 @@ import android.Manifest // For Manifest.permission.POST_NOTIFICATIONS import androidx.compose.material3.AlertDialog // For the rationale dialog import androidx.compose.runtime.saveable.rememberSaveable import android.util.Log +import android.os.Environment +import android.os.StatFs +import com.google.ai.sample.feature.multimodal.ModelDownloadManager +import java.io.File data class MenuItem( val routeId: String, @@ -67,6 +71,8 @@ fun MenuScreen( val currentModel = GenerativeAiViewModelFactory.getCurrentModel() var selectedModel by remember { mutableStateOf(currentModel) } var expanded by remember { mutableStateOf(false) } + var showDownloadDialog by remember { mutableStateOf(false) } + var downloadDialogModel by remember { mutableStateOf(null) } Column( modifier = Modifier @@ -152,11 +158,24 @@ fun MenuScreen( orderedModels.forEach { modelOption -> DropdownMenuItem( - text = { Text(modelOption.displayName) }, + text = { + Text(modelOption.displayName + (modelOption.size?.let { " - $it" } ?: "")) + }, onClick = { - selectedModel = modelOption - GenerativeAiViewModelFactory.setModel(modelOption) expanded = false + if (modelOption == ModelOption.GEMMA_3N_E4B_IT) { + val isDownloaded = ModelDownloadManager.isModelDownloaded(context) + if (!isDownloaded) { + downloadDialogModel = modelOption + showDownloadDialog = true + } else { + selectedModel = modelOption + GenerativeAiViewModelFactory.setModel(modelOption) + } + } else { + selectedModel = modelOption + GenerativeAiViewModelFactory.setModel(modelOption) + } }, enabled = true // Always enabled ) @@ -195,6 +214,19 @@ fun MenuScreen( } else { if (menuItem.routeId == "photo_reasoning") { val mainActivity = context as? MainActivity + val currentModel = GenerativeAiViewModelFactory.getCurrentModel() + // Check API Key for online models + if (currentModel.apiProvider != ApiProvider.GOOGLE || !currentModel.modelName.contains("litert")) { // Simple check, refine if needed. Actually offline model has specific Enum + if (currentModel != ModelOption.GEMMA_3N_E4B_IT) { + val apiKey = mainActivity?.getCurrentApiKey(currentModel.apiProvider) + if (apiKey.isNullOrEmpty()) { + // Show API Key Dialog + onApiKeyButtonClicked() // Or a specific callback to show dialog + return@TextButton + } + } + } + if (mainActivity != null) { // Ensure mainActivity is not null if (!mainActivity.isNotificationPermissionGranted()) { Log.d("MenuScreen", "Notification permission NOT granted.") @@ -351,6 +383,41 @@ GPT-5 nano Input: $0.05/M Output: $0.40/M } ) } + + if (showDownloadDialog && downloadDialogModel != null) { + val context = LocalContext.current + val statFs = StatFs(Environment.getExternalStorageDirectory().path) + val bytesAvailable = statFs.availableBlocksLong * statFs.blockSizeLong + val gbAvailable = bytesAvailable.toDouble() / (1024 * 1024 * 1024) + val formattedGbAvailable = String.format("%.2f", gbAvailable) + + AlertDialog( + onDismissRequest = { showDownloadDialog = false }, + title = { Text("Download Model? (4.92 GB)") }, + text = { Text("Should the Gemma 3n E4B be downloaded?\n\n$formattedGbAvailable GB of storage available.") }, + confirmButton = { + TextButton( + onClick = { + showDownloadDialog = false + downloadDialogModel?.downloadUrl?.let { url -> + ModelDownloadManager.downloadModel(context, url) + // We set the model, but the user will have to wait for download + selectedModel = downloadDialogModel!! + GenerativeAiViewModelFactory.setModel(downloadDialogModel!!) + } + } + ) { Text("OK") } + }, + dismissButton = { + TextButton( + onClick = { + showDownloadDialog = false + // Do not change model + } + ) { Text("ABORT") } + } + ) + } } @Preview(showSystemUi = true) diff --git a/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/ModelDownloadManager.kt b/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/ModelDownloadManager.kt new file mode 100644 index 0000000..a66b9e0 --- /dev/null +++ b/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/ModelDownloadManager.kt @@ -0,0 +1,82 @@ +package com.google.ai.sample.feature.multimodal + +import android.app.DownloadManager +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.IntentFilter +import android.database.Cursor +import android.net.Uri +import android.util.Log +import android.widget.Toast +import java.io.File + +object ModelDownloadManager { + private const val TAG = "ModelDownloadManager" + const val MODEL_FILENAME = "gemma-3n-e4b-it-int4.litertlm" + private var downloadId: Long = -1 + + fun isModelDownloaded(context: Context): Boolean { + val file = getModelFile(context) + return file != null && file.exists() && file.length() > 0 + } + + fun getModelFile(context: Context): File? { + val externalFilesDir = context.getExternalFilesDir(null) + return if (externalFilesDir != null) { + File(externalFilesDir, MODEL_FILENAME) + } else { + Log.e(TAG, "External files directory is not available.") + null + } + } + + fun downloadModel(context: Context, url: String) { + if (isModelDownloaded(context)) { + Toast.makeText(context, "Model already downloaded.", Toast.LENGTH_SHORT).show() + return + } + + val file = getModelFile(context) + if (file != null && file.exists()) { + file.delete() // Clean up partial or old file + } + + try { + val request = DownloadManager.Request(Uri.parse(url)) + .setTitle("Downloading Gemma Model") + .setDescription("Downloading offline AI model (4.92 GB)...") + .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) + .setDestinationInExternalFilesDir(context, null, MODEL_FILENAME) + .setAllowedOverMetered(true) + .setAllowedOverRoaming(true) + + val downloadManager = context.getSystemService(Context.DOWNLOAD_SERVICE) as? DownloadManager + + if (downloadManager != null) { + downloadId = downloadManager.enqueue(request) + Toast.makeText(context, "Download started. Please do not pause the download, as it cannot be resumed.", Toast.LENGTH_LONG).show() + Log.d(TAG, "Download started with ID: $downloadId") + } else { + Log.e(TAG, "DownloadManager service not available.") + Toast.makeText(context, "Download service unavailable.", Toast.LENGTH_SHORT).show() + } + } catch (e: Exception) { + Log.e(TAG, "Error starting download: ${e.message}") + Toast.makeText(context, "Failed to start download.", Toast.LENGTH_SHORT).show() + } + } + + fun cancelDownload(context: Context) { + if (downloadId != -1L) { + val downloadManager = context.getSystemService(Context.DOWNLOAD_SERVICE) as? DownloadManager + if (downloadManager != null) { + downloadManager.remove(downloadId) + downloadId = -1 + Toast.makeText(context, "Download cancelled.", Toast.LENGTH_SHORT).show() + } else { + Log.e(TAG, "DownloadManager service not available for cancellation.") + } + } + } +} diff --git a/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt b/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt index e12d751..91433e5 100644 --- a/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt +++ b/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt @@ -102,6 +102,12 @@ import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import androidx.lifecycle.viewmodel.compose.viewModel +import androidx.compose.foundation.Canvas +import androidx.compose.runtime.derivedStateOf +import androidx.compose.ui.geometry.CornerRadius +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Size +import androidx.compose.foundation.lazy.LazyListState import coil.ImageLoader import coil.compose.AsyncImage import coil.request.ImageRequest @@ -155,6 +161,7 @@ internal fun PhotoReasoningRoute( val chatMessages by viewModel.chatMessagesFlow.collectAsState() val isInitialized by viewModel.isInitialized.collectAsState() val modelName by viewModel.modelNameState.collectAsState() + val userInput by viewModel.userInput.collectAsState() // Hoisted: var showNotificationRationaleDialog by rememberSaveable { mutableStateOf(false) } // This state will now be managed in PhotoReasoningRoute and passed down. @@ -218,8 +225,11 @@ internal fun PhotoReasoningRoute( isAccessibilityServiceEnabled = isAccessibilityServiceEffectivelyEnabled, isMediaProjectionPermissionGranted = isMediaProjectionPermissionGranted, onEnableAccessibilityService = { - val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS) + val intent = Settings.ACTION_ACCESSIBILITY_SETTINGS try { + // val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS) // Corrected + // accessibilitySettingsLauncher.launch(intent) // Corrected below + val intent = Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS) accessibilitySettingsLauncher.launch(intent) } catch (e: Exception) { Toast.makeText(context, "Error opening Accessibility Settings.", Toast.LENGTH_LONG).show() @@ -233,7 +243,9 @@ internal fun PhotoReasoningRoute( // showNotificationRationaleDialog = showNotificationRationaleDialogStateInRoute, // Removed // onShowNotificationRationaleDialogChange = { showNotificationRationaleDialogStateInRoute = it }, // Removed isInitialized = isInitialized, // Pass the collected state - modelName = modelName + modelName = modelName, + userQuestion = userInput, + onUserQuestionChanged = { viewModel.updateUserInput(it) } ) } @@ -257,9 +269,10 @@ fun PhotoReasoningScreen( // showNotificationRationaleDialog: Boolean, // Removed // onShowNotificationRationaleDialogChange: (Boolean) -> Unit, // Removed isInitialized: Boolean = true, // Added parameter with default for preview - modelName: String = "" + modelName: String = "", + userQuestion: String = "", + onUserQuestionChanged: (String) -> Unit = {} ) { - var userQuestion by rememberSaveable { mutableStateOf("") } val imageUris = rememberSaveable(saver = UriSaver()) { mutableStateListOf() } var isSystemMessageFocused by rememberSaveable { mutableStateOf(false) } var showDatabaseListPopup by rememberSaveable { mutableStateOf(false) } @@ -408,53 +421,59 @@ fun PhotoReasoningScreen( } } - LazyColumn(state = listState, modifier = Modifier.fillMaxWidth().weight(1f)) { - items(messages) { message -> - when (message.participant) { - PhotoParticipant.USER -> UserChatBubble(message.text, message.isPending, message.imageUris) - PhotoParticipant.MODEL -> ModelChatBubble(message.text, message.isPending) - PhotoParticipant.ERROR -> ErrorChatBubble(message.text) + Box(modifier = Modifier.fillMaxWidth().weight(1f)) { + LazyColumn(state = listState, modifier = Modifier.fillMaxSize()) { + items(messages) { message -> + when (message.participant) { + PhotoParticipant.USER -> UserChatBubble(message.text, message.isPending, message.imageUris) + PhotoParticipant.MODEL -> ModelChatBubble(message.text, message.isPending) + PhotoParticipant.ERROR -> ErrorChatBubble(message.text) + } } - } - if (commandExecutionStatus.isNotEmpty()) { - item { - Card( - modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp, horizontal = 8.dp).wrapContentHeight(), - colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.secondaryContainer) - ) { - Column(modifier = Modifier.padding(16.dp)) { - Text("Command Status:", style = MaterialTheme.typography.titleMedium) - Spacer(Modifier.height(4.dp)) - Text(commandExecutionStatus, color = MaterialTheme.colorScheme.onSecondaryContainer) + if (commandExecutionStatus.isNotEmpty()) { + item { + Card( + modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp, horizontal = 8.dp).wrapContentHeight(), + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.secondaryContainer) + ) { + Column(modifier = Modifier.padding(16.dp)) { + Text("Command Status:", style = MaterialTheme.typography.titleMedium) + Spacer(Modifier.height(4.dp)) + Text(commandExecutionStatus, color = MaterialTheme.colorScheme.onSecondaryContainer) + } } } } - } - if (detectedCommands.isNotEmpty()) { - item { - Card( - modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp, horizontal = 8.dp).wrapContentHeight(), - colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.tertiaryContainer) - ) { - Column(modifier = Modifier.padding(16.dp)) { - Text("Detected Commands:", style = MaterialTheme.typography.titleMedium) - Spacer(Modifier.height(4.dp)) - detectedCommands.forEachIndexed { index, command -> - val commandText = when (command) { - is Command.ClickButton -> "Click on button: \"${command.buttonText}\"" - is Command.TapCoordinates -> "Tap coordinates: (${command.x}, ${command.y})" - is Command.TakeScreenshot -> "Take screenshot" - else -> command::class.simpleName ?: "Unknown Command" + if (detectedCommands.isNotEmpty()) { + item { + Card( + modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp, horizontal = 8.dp).wrapContentHeight(), + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.tertiaryContainer) + ) { + Column(modifier = Modifier.padding(16.dp)) { + Text("Detected Commands:", style = MaterialTheme.typography.titleMedium) + Spacer(Modifier.height(4.dp)) + detectedCommands.forEachIndexed { index, command -> + val commandText = when (command) { + is Command.ClickButton -> "Click on button: \"${command.buttonText}\"" + is Command.TapCoordinates -> "Tap coordinates: (${command.x}, ${command.y})" + is Command.TakeScreenshot -> "Take screenshot" + else -> command::class.simpleName ?: "Unknown Command" + } + Text("${index + 1}. $commandText", color = MaterialTheme.colorScheme.onTertiaryContainer) + if (index < detectedCommands.size - 1) Divider(Modifier.padding(vertical = 4.dp), color = MaterialTheme.colorScheme.onTertiaryContainer.copy(alpha = 0.2f)) } - Text("${index + 1}. $commandText", color = MaterialTheme.colorScheme.onTertiaryContainer) - if (index < detectedCommands.size - 1) Divider(Modifier.padding(vertical = 4.dp), color = MaterialTheme.colorScheme.onTertiaryContainer.copy(alpha = 0.2f)) } } } } } + VerticalScrollbar( + modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight(), + listState = listState + ) } val showStopButton = uiState is PhotoReasoningUiState.Loading // commandExecutionStatus check is implicitly handled by cards in LazyColumn @@ -476,7 +495,7 @@ fun PhotoReasoningScreen( value = userQuestion, label = { Text(stringResource(R.string.reason_label)) }, placeholder = { Text(stringResource(R.string.reason_hint)) }, - onValueChange = { userQuestion = it }, + onValueChange = onUserQuestionChanged, modifier = Modifier.weight(1f).padding(end = 8.dp) ) IconButton( @@ -496,7 +515,7 @@ fun PhotoReasoningScreen( // This block will be executed after permission is granted if (userQuestion.isNotBlank()) { onReasonClicked(userQuestion, imageUris.toList()) - userQuestion = "" + onUserQuestionChanged("") imageUris.clear() } } @@ -506,7 +525,7 @@ fun PhotoReasoningScreen( if (userQuestion.isNotBlank()) { onReasonClicked(userQuestion, imageUris.toList()) - userQuestion = "" + onUserQuestionChanged("") imageUris.clear() } }, @@ -1271,3 +1290,45 @@ fun StopButtonPreview() { StopButton {} } } + +@Composable +fun VerticalScrollbar( + modifier: Modifier = Modifier, + listState: LazyListState +) { + val scrollbarState by remember { + derivedStateOf { + val layoutInfo = listState.layoutInfo + val totalItems = layoutInfo.totalItemsCount + if (totalItems == 0) return@derivedStateOf null + + val viewportHeight = layoutInfo.viewportSize.height.toFloat() + // Avoid division by zero and complex layout loops + val firstVisibleItemIndex = listState.firstVisibleItemIndex + val firstVisibleItemScrollOffset = listState.firstVisibleItemScrollOffset + + // Simple estimation logic + val elementHeight = if (layoutInfo.visibleItemsInfo.isNotEmpty()) + layoutInfo.visibleItemsInfo.sumOf { it.size } / layoutInfo.visibleItemsInfo.size.toFloat() + else 100f // Fallback + + val estimatedTotalHeight = elementHeight * totalItems + val thumbHeight = ((viewportHeight / estimatedTotalHeight) * viewportHeight).coerceAtLeast(20f) // Min size + val scrollOffset = ((firstVisibleItemIndex * elementHeight) + firstVisibleItemScrollOffset) / estimatedTotalHeight * viewportHeight + + Pair(scrollOffset, thumbHeight) + } + } + + if (scrollbarState != null) { + val (offset, height) = scrollbarState!! + Canvas(modifier = modifier.width(4.dp)) { + drawRoundRect( + color = Color.Gray, + topLeft = Offset(0f, offset), + size = Size(size.width, height), + cornerRadius = CornerRadius(4.dp.toPx()) + ) + } + } +} diff --git a/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt b/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt index 98b352e..c472f67 100644 --- a/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt +++ b/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt @@ -1,5 +1,6 @@ package com.google.ai.sample.feature.multimodal +import android.app.Application import android.app.ActivityManager import android.app.ActivityManager.RunningAppProcessInfo import android.content.Context @@ -11,7 +12,7 @@ import android.net.Uri import android.os.Build import android.util.Log import android.widget.Toast -import androidx.lifecycle.ViewModel +import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope import coil.ImageLoader import coil.request.ImageRequest @@ -34,6 +35,9 @@ import com.google.ai.sample.util.CommandParser import com.google.ai.sample.util.SystemMessagePreferences import com.google.ai.sample.util.SystemMessageEntryPreferences // Added import import com.google.ai.sample.util.SystemMessageEntry // Added import +import com.google.ai.sample.feature.multimodal.ModelDownloadManager // Added import +import com.google.ai.sample.ModelOption // Added import +import com.google.ai.sample.GenerativeAiViewModelFactory // Added import import com.google.ai.sample.feature.multimodal.dtos.toDto // Added for DTO mapping import com.google.ai.sample.feature.multimodal.dtos.ImagePartDto // Required for path extraction import kotlinx.coroutines.Dispatchers @@ -44,14 +48,10 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import androidx.localbroadcastmanager.content.LocalBroadcastManager -// Removed duplicate StateFlow import -// Removed duplicate asStateFlow import -// import kotlinx.coroutines.isActive // Removed as we will use job.isActive import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.io.IOException -// import kotlin.coroutines.coroutineContext // Removed if not used import java.util.concurrent.atomic.AtomicBoolean import android.graphics.Bitmap @@ -59,6 +59,7 @@ import java.io.ByteArrayOutputStream import android.util.Base64 import com.google.ai.sample.feature.live.LiveApiManager import com.google.ai.sample.ApiProvider +import com.google.mediapipe.tasks.genai.llminference.LlmInference import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.Request @@ -70,21 +71,24 @@ import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive class PhotoReasoningViewModel( + application: Application, private var generativeModel: GenerativeModel, private val modelName: String, private val liveApiManager: LiveApiManager? = null -) : ViewModel() { +) : AndroidViewModel(application) { private val isLiveMode: Boolean get() = liveApiManager != null + private var llmInference: LlmInference? = null + private val TAG = "PhotoReasoningViewModel" + private fun Bitmap.toBase64(): String { val outputStream = ByteArrayOutputStream() this.compress(Bitmap.CompressFormat.JPEG, 90, outputStream) val bytes = outputStream.toByteArray() return Base64.encodeToString(bytes, Base64.NO_WRAP) } - private val TAG = "PhotoReasoningViewModel" private val _uiState: MutableStateFlow = MutableStateFlow(PhotoReasoningUiState.Initial) @@ -107,6 +111,14 @@ class PhotoReasoningViewModel( // Keep track of the current user input private var currentUserInput: String = "" + + // Observable state for the input field to persist across configuration changes + private val _userInput = MutableStateFlow("") + val userInput: StateFlow = _userInput.asStateFlow() + + fun updateUserInput(text: String) { + _userInput.value = text + } // Keep track of detected commands private val _detectedCommands = MutableStateFlow>(emptyList()) @@ -175,14 +187,10 @@ class PhotoReasoningViewModel( _uiState.value = PhotoReasoningUiState.Success(responseText) finalizeAiMessage(responseText) processCommands(responseText) - saveChatHistory(MainActivity.getInstance()?.applicationContext) + saveChatHistory(getApplication()) } else if (errorMessage != null) { Log.e(TAG, "AI Call Error via Broadcast: $errorMessage") - if (context == null) { - Log.e(TAG, "Context null in receiver, cannot handle error") - return - } - val receiverContext = context + val receiverContext = context ?: getApplication() _uiState.value = PhotoReasoningUiState.Error(errorMessage) _commandExecutionStatus.value = "Error during AI generation: $errorMessage" _chatState.replaceLastPendingMessage() @@ -224,7 +232,7 @@ class PhotoReasoningViewModel( ) ) _chatMessagesFlow.value = chatMessages - saveChatHistory(MainActivity.getInstance()?.applicationContext) + saveChatHistory(getApplication()) } // Reset pending AI message if any (assuming updateAiMessage or error handling does this) } @@ -232,36 +240,65 @@ class PhotoReasoningViewModel( } init { - // ... other init logic - val context = MainActivity.getInstance()?.applicationContext - if (context != null) { - val filter = IntentFilter(ScreenCaptureService.ACTION_AI_CALL_RESULT) - LocalBroadcastManager.getInstance(context).registerReceiver(aiResultReceiver, filter) - Log.d(TAG, "AIResultReceiver registered with LocalBroadcastManager.") - - val streamFilter = IntentFilter(ScreenCaptureService.ACTION_AI_STREAM_UPDATE) - LocalBroadcastManager.getInstance(context).registerReceiver(aiResultStreamReceiver, streamFilter) - Log.d(TAG, "AIResultStreamReceiver registered with LocalBroadcastManager.") - } else { - Log.e(TAG, "Failed to register AIResultReceiver: applicationContext is null at init.") + // Initialize model if it's the offline one and already downloaded + val currentModel = com.google.ai.sample.GenerativeAiViewModelFactory.getCurrentModel() + val context = getApplication().applicationContext + if (currentModel == ModelOption.GEMMA_3N_E4B_IT) { + if (ModelDownloadManager.isModelDownloaded(context)) { + initializeOfflineModel(context) + } + } + + // Register receivers after initialization block to ensure properties are initialized + val filter = IntentFilter(ScreenCaptureService.ACTION_AI_CALL_RESULT) + LocalBroadcastManager.getInstance(context).registerReceiver(aiResultReceiver, filter) + Log.d(TAG, "AIResultReceiver registered with LocalBroadcastManager.") + + val streamFilter = IntentFilter(ScreenCaptureService.ACTION_AI_STREAM_UPDATE) + LocalBroadcastManager.getInstance(context).registerReceiver(aiResultStreamReceiver, streamFilter) + Log.d(TAG, "AIResultStreamReceiver registered with LocalBroadcastManager.") + } + + private fun initializeOfflineModel(context: Context) { + viewModelScope.launch(Dispatchers.IO) { + try { + if (llmInference == null) { + val modelFile = ModelDownloadManager.getModelFile(context) + if (modelFile != null && modelFile.exists()) { + val options = LlmInference.LlmInferenceOptions.builder() + .setModelPath(modelFile.absolutePath) + .setMaxTokens(1024) + .build() + llmInference = LlmInference.createFromOptions(context, options) + Log.d(TAG, "Offline model initialized.") + } + } + } catch (e: Exception) { + Log.e(TAG, "Failed to initialize offline model", e) + } } } override fun onCleared() { super.onCleared() liveApiManager?.close() - val context = MainActivity.getInstance()?.applicationContext - if (context != null) { - LocalBroadcastManager.getInstance(context).unregisterReceiver(aiResultReceiver) - Log.d(TAG, "AIResultReceiver unregistered with LocalBroadcastManager.") - LocalBroadcastManager.getInstance(context).unregisterReceiver(aiResultStreamReceiver) - Log.d(TAG, "AIResultStreamReceiver unregistered with LocalBroadcastManager.") + val context = getApplication().applicationContext + LocalBroadcastManager.getInstance(context).unregisterReceiver(aiResultReceiver) + Log.d(TAG, "AIResultReceiver unregistered with LocalBroadcastManager.") + LocalBroadcastManager.getInstance(context).unregisterReceiver(aiResultStreamReceiver) + Log.d(TAG, "AIResultStreamReceiver unregistered with LocalBroadcastManager.") + + try { + // Using reflection if specific method not known or standard cast + (llmInference as? java.io.Closeable)?.close() + } catch (e: Exception) { + Log.w(TAG, "Error closing LlmInference", e) } - // ... other onCleared logic + llmInference = null } private fun createChatWithSystemMessage(context: Context? = null): Chat { - val ctx = context ?: MainActivity.getInstance()?.applicationContext + val ctx = context ?: getApplication() val history = mutableListOf() if (_systemMessage.value.isNotBlank()) { history.add(content(role = "user") { text(_systemMessage.value) }) @@ -288,10 +325,10 @@ class PhotoReasoningViewModel( imageUrisForChat: List? = null ) { // Get context for rebuildChatHistory - val context = MainActivity.getInstance()?.applicationContext + val context = getApplication().applicationContext // Update the generative model with the current API key if retrying - if (currentRetryAttempt > 0 && context != null) { + if (currentRetryAttempt > 0) { val apiKeyManager = ApiKeyManager.getInstance(context) val currentModel = com.google.ai.sample.GenerativeAiViewModelFactory.getCurrentModel() val currentKey = apiKeyManager.getCurrentApiKey(currentModel.apiProvider) @@ -413,6 +450,48 @@ class PhotoReasoningViewModel( imageUrisForChat: List? = null ) { val currentModel = com.google.ai.sample.GenerativeAiViewModelFactory.getCurrentModel() + + // Check for offline model (Gemma) + if (currentModel == ModelOption.GEMMA_3N_E4B_IT) { + val context = getApplication().applicationContext + + if (!ModelDownloadManager.isModelDownloaded(context)) { + _uiState.value = PhotoReasoningUiState.Error("Model not downloaded.") + return + } + + _uiState.value = PhotoReasoningUiState.Loading + viewModelScope.launch(Dispatchers.IO) { + try { + if (llmInference == null) { + initializeOfflineModel(context) + val modelFile = ModelDownloadManager.getModelFile(context) + if (modelFile != null && modelFile.exists()) { + val options = LlmInference.LlmInferenceOptions.builder() + .setModelPath(modelFile.absolutePath) + .setMaxTokens(1024) + .build() + llmInference = LlmInference.createFromOptions(context, options) + } + } + + val response = llmInference?.generateResponse(userInput) ?: "Error: Inference engine not initialized" + + withContext(Dispatchers.Main) { + _uiState.value = PhotoReasoningUiState.Success(response) + finalizeAiMessage(response) + processCommands(response) + saveChatHistory(context) + } + } catch (e: Exception) { + withContext(Dispatchers.Main) { + _uiState.value = PhotoReasoningUiState.Error("Offline inference failed: ${e.message}") + } + } + } + return + } + if (currentModel.apiProvider == ApiProvider.CEREBRAS) { reasonWithCerebras(userInput, selectedImages, screenInfoForPrompt) return @@ -474,7 +553,7 @@ class PhotoReasoningViewModel( ) ) _chatMessagesFlow.value = _chatState.getAllMessages() - saveChatHistory(MainActivity.getInstance()?.applicationContext) + saveChatHistory(getApplication()) } } } else { @@ -497,7 +576,7 @@ class PhotoReasoningViewModel( screenInfoForPrompt: String? = null ) { _uiState.value = PhotoReasoningUiState.Loading - val context = MainActivity.getInstance()?.applicationContext ?: return + val context = getApplication().applicationContext val apiKeyManager = ApiKeyManager.getInstance(context) val apiKey = apiKeyManager.getCurrentApiKey(ApiProvider.CEREBRAS) @@ -605,11 +684,10 @@ class PhotoReasoningViewModel( if (liveApiManager != null) { // Set system message and history when connecting viewModelScope.launch { - val context = MainActivity.getInstance()?.applicationContext - if (context != null) { - ensureInitialized(context) + val context = getApplication().applicationContext + ensureInitialized(context) - // Convert chat history to format for Live API + // Convert chat history to format for Live API val historyPairs = mutableListOf>() // Add system message and DB entries as initial context @@ -642,8 +720,7 @@ class PhotoReasoningViewModel( } } - liveApiManager.setSystemMessageAndHistory(_systemMessage.value, historyPairs) - } + liveApiManager.setSystemMessageAndHistory(_systemMessage.value, historyPairs) } // Collect messages @@ -689,7 +766,7 @@ class PhotoReasoningViewModel( processCommands(finalMessage.text) // Save chat history - saveChatHistory(MainActivity.getInstance()?.applicationContext) + saveChatHistory(getApplication()) } } } @@ -908,7 +985,7 @@ class PhotoReasoningViewModel( ) _chatMessagesFlow.value = _chatState.getAllMessages() } - saveChatHistory(MainActivity.getInstance()?.applicationContext) + saveChatHistory(getApplication()) } private fun updateAiMessage(text: String, isPending: Boolean = false) { @@ -938,7 +1015,7 @@ class PhotoReasoningViewModel( // Save chat history after updating message if (!stopExecutionFlag.get() || text.contains("stopped by user", ignoreCase = true)) { - saveChatHistory(MainActivity.getInstance()?.applicationContext) + saveChatHistory(getApplication()) } } @@ -1306,18 +1383,6 @@ data class CerebrasResponseMessage( context: Context, screenInfo: String? = null ) { - if (modelName == "gemma-3n-e4b-it") { - // If the model is gemma-3n-e4b-it, we don't want to send the screenshot. - // Instead, we'll just send the screen info. - val genericAnalysisPrompt = "" - reason( - userInput = genericAnalysisPrompt, - selectedImages = emptyList(), - screenInfoForPrompt = screenInfo, - imageUrisForChat = emptyList() - ) - return - } if (screenshotUri == Uri.EMPTY) { // This case is for gemma-3n-e4b-it, where we don't have a screenshot. // We just want to send the screen info. diff --git a/build_and_sign.sh b/build_and_sign.sh index dd95326..6abfcb5 100755 --- a/build_and_sign.sh +++ b/build_and_sign.sh @@ -1,51 +1,29 @@ #!/bin/bash set -e echo "INFO: Starting build and sign process." +# Android SDK is already there -# 1. Set up the Android SDK directory -echo "INFO: Setting up Android SDK directory..." -mkdir -p android_sdk -echo "sdk.dir=android_sdk" > local.properties - -# Add android_sdk to .gitignore if it's not already there -if ! grep -q "android_sdk/" .gitignore; then - echo "INFO: Adding android_sdk/ to .gitignore." - echo "android_sdk/" >> .gitignore -fi - -# 2. Download and unzip the Android SDK command-line tools -echo "INFO: Downloading Android SDK..." -wget -q https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip -unzip -oq commandlinetools-linux-13114758_latest.zip -d android_sdk -rm commandlinetools-linux-13114758_latest.zip - -# 3. Restructure cmdline-tools for sdkmanager -echo "INFO: Restructuring cmdline-tools..." -mkdir -p android_sdk/cmdline-tools/latest -mv android_sdk/cmdline-tools/* android_sdk/cmdline-tools/latest/ 2>/dev/null || true - -# 4. Install required SDK packages -echo "INFO: Installing SDK packages..." -yes | android_sdk/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null -android_sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-35" "build-tools;35.0.0" "platform-tools" > /dev/null - -# 5. Build the Unsigned APK +# 1. Build the Unsigned APK echo "INFO: Building the application..." ./gradlew assembleRelease -# 6. Generate a Test Signing Key -echo "INFO: Generating test signing key..." -keytool -genkey -v \ - -keystore debug.keystore \ - -storepass android \ - -alias androiddebugkey \ - -keypass android \ - -keyalg RSA \ - -keysize 2048 \ - -validity 10000 \ - -dname "CN=Android Debug,O=Android,C=US" +# 2. Generate a Test Signing Key +if [ -f debug.keystore ]; then + echo "INFO: debug.keystore already exists. Skipping generation." +else + echo "INFO: Generating test signing key..." + keytool -genkey -v \ + -keystore debug.keystore \ + -storepass android \ + -alias androiddebugkey \ + -keypass android \ + -keyalg RSA \ + -keysize 2048 \ + -validity 10000 \ + -dname "CN=Android Debug,O=Android,C=US" +fi -# 7. Sign the APK +# 3. Sign the APK echo "INFO: Signing the APK..." android_sdk/build-tools/35.0.0/apksigner sign \ --ks debug.keystore \ diff --git a/build_and_sign_verbose.sh b/build_and_sign_verbose.sh deleted file mode 100644 index 709cf2d..0000000 --- a/build_and_sign_verbose.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -set -e -echo "INFO: Starting build and sign process." - -# 1. Set up the Android SDK directory -echo "INFO: Setting up Android SDK directory..." -mkdir -p android_sdk -echo "sdk.dir=android_sdk" > local.properties - -# Add android_sdk to .gitignore if it's not already there -if ! grep -q "android_sdk/" .gitignore; then - echo "INFO: Adding android_sdk/ to .gitignore." - echo "android_sdk/" >> .gitignore -fi - -# 2. Download and unzip the Android SDK command-line tools -echo "INFO: Downloading Android SDK..." -wget -q https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip -unzip -q commandlinetools-linux-13114758_latest.zip -d android_sdk -rm commandlinetools-linux-13114758_latest.zip - -# 3. Restructure cmdline-tools for sdkmanager -echo "INFO: Restructuring cmdline-tools..." -mkdir -p android_sdk/cmdline-tools/latest -mv android_sdk/cmdline-tools/* android_sdk/cmdline-tools/latest/ 2>/dev/null || true - -# 4. Install required SDK packages -echo "INFO: Installing SDK packages..." -yes | android_sdk/cmdline-tools/latest/bin/sdkmanager --licenses -android_sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-35" "build-tools;35.0.0" "platform-tools" - -# 5. Build the Unsigned APK -echo "INFO: Building the application..." -./gradlew assembleRelease - -# 6. Generate a Test Signing Key -echo "INFO: Generating test signing key..." -keytool -genkey -v \ - -keystore debug.keystore \ - -storepass android \ - -alias androiddebugkey \ - -keypass android \ - -keyalg RSA \ - -keysize 2048 \ - -validity 10000 \ - -dname "CN=Android Debug,O=Android,C=US" - -# 7. Sign the APK -echo "INFO: Signing the APK..." -android_sdk/build-tools/35.0.0/apksigner sign \ - --ks debug.keystore \ - --ks-pass pass:android \ - --out app-release-signed.apk \ - app/build/outputs/apk/release/app-release-unsigned.apk - -echo "INFO: Build and sign process complete." diff --git a/build_log.txt b/build_log.txt new file mode 100644 index 0000000..f03c24f --- /dev/null +++ b/build_log.txt @@ -0,0 +1,69 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData +> Task :app:writeReleaseAppMetadata +> Task :app:writeReleaseSigningConfigVersions +> Task :app:optimizeReleaseResources + +> Task :app:compileReleaseKotlin FAILED +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:19:22 Unresolved reference: edge +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:20:22 Unresolved reference: edge +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:88:31 Unresolved reference: LlmInference +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:444:39 Unresolved reference: LlmInferenceOptions +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:448:40 Unresolved reference: LlmInference + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 31s +34 actionable tasks: 6 executed, 28 up-to-date diff --git a/build_log_2.txt b/build_log_2.txt new file mode 100644 index 0000000..698c7ba --- /dev/null +++ b/build_log_2.txt @@ -0,0 +1,150 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs +> Task :app:stripReleaseDebugSymbols +> Task :app:extractReleaseNativeSymbolTables +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:checkReleaseDuplicateClasses +> Task :app:collectReleaseDependencies +> Task :app:sdkReleaseDependencyData +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE +> Task :app:processReleaseResources +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:mergeExtDexRelease +> Task :app:compileReleaseKotlin +w: file:///app/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt:50:9 The corresponding parameter in the supertype 'Factory' is named 'modelClass'. This may cause problems when calling this function with named arguments. +w: file:///app/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt:72:25 Name shadowed: currentModel +w: file:///app/app/src/main/kotlin/com/google/ai/sample/GenerativeAiViewModelFactory.kt:115:11 Unchecked cast: PhotoReasoningViewModel to T +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt:795:14 'enablePendingPurchases(): BillingClient.Builder' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt:1201:5 Parameter 'onDismiss' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:52:47 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:285:41 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:290:37 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:291:89 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:293:33 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:293:35 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:294:33 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:294:35 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:295:33 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:295:35 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:298:48 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:298:50 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:317:34 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:343:29 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:482:56 'getter for defaultDisplay: Display!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:484:40 'getRealMetrics(DisplayMetrics!): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:732:2 This declaration needs opt-in. Its usage should be marked with '@kotlinx.serialization.ExperimentalSerializationApi' or '@OptIn(kotlinx.serialization.ExperimentalSerializationApi::class)' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenCaptureService.kt:800:25 Name shadowed: json +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:163:42 'FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY: Int' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:432:14 Unnecessary safe call on a non-null receiver of type AccessibilityEvent +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:526:29 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:565:34 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:584:46 'obtain(AccessibilityNodeInfo!): AccessibilityNodeInfo!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:591:23 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:611:46 'obtain(AccessibilityNodeInfo!): AccessibilityNodeInfo!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:618:23 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:731:22 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:744:73 Parameter 'buttonText' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:790:22 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:827:22 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:864:22 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:913:22 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:962:22 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:979:46 'obtain(AccessibilityNodeInfo!): AccessibilityNodeInfo!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:986:23 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1007:46 'obtain(AccessibilityNodeInfo!): AccessibilityNodeInfo!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1014:23 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1035:46 'obtain(AccessibilityNodeInfo!): AccessibilityNodeInfo!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1042:23 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1085:52 'obtain(AccessibilityNodeInfo!): AccessibilityNodeInfo!' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1092:23 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1127:28 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1132:24 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1158:28 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1163:24 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1590:21 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1619:22 'capitalize(Locale): String' is deprecated. Use replaceFirstChar instead. +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1645:32 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1654:37 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1655:36 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1658:33 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1663:32 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/ScreenOperatorAccessibilityService.kt:1667:28 'recycle(): Unit' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:161:9 Variable 'chatMessages' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:459:76 'Divider(Modifier = ..., Dp = ..., Color = ...): Unit' is deprecated. Renamed to HorizontalDivider +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:529:47 'Send: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Send +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:746:48 Check for instance is always 'false' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:975:5 Parameter 'onSkipAll' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:50:47 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:244:13 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:248:13 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:260:13 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:262:13 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:540:9 Parameter 'selectedImages' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:824:69 Parameter 'retryCount' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/util/AppNamePackageMapper.kt:177:23 Name shadowed: appName +w: file:///app/app/src/main/kotlin/com/google/ai/sample/util/AppNamePackageMapper.kt:178:25 Name shadowed: packageName +w: file:///app/app/src/main/kotlin/com/google/ai/sample/util/CommandParser.kt:114:17 Variable 'lines' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/util/ImageUtils.kt:16:13 Variable 'safeQuality' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/util/ImageUtils.kt:76:9 Unreachable code + +> Task :app:compileReleaseJavaWithJavac +warning: [options] source value 8 is obsolete and will be removed in a future release +warning: [options] target value 8 is obsolete and will be removed in a future release +warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. +3 warnings + +> Task :app:lintVitalAnalyzeRelease +> Task :app:dexBuilderRelease +> Task :app:mergeReleaseGlobalSynthetics +> Task :app:processReleaseJavaRes +> Task :app:mergeReleaseJavaResource +> Task :app:mergeDexRelease +> Task :app:compileReleaseArtProfile +> Task :app:packageRelease +> Task :app:createReleaseApkListingFileRedirect +> Task :app:lintVitalReportRelease +> Task :app:lintVitalRelease +> Task :app:assembleRelease + +BUILD SUCCESSFUL in 2m 12s +46 actionable tasks: 23 executed, 23 up-to-date +INFO: Generating test signing key... +Generating 2,048 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 10,000 days + for: CN=Android Debug, O=Android, C=US +[Storing debug.keystore] +INFO: Signing the APK... +INFO: Build and sign process complete. diff --git a/build_log_final.txt b/build_log_final.txt new file mode 100644 index 0000000..573d915 --- /dev/null +++ b/build_log_final.txt @@ -0,0 +1,75 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:processReleaseResources + +> Task :app:stripReleaseDebugSymbols +Unable to strip the following libraries, packaging them as they are: libllm_inference_engine_jni.so. + +> Task :app:checkReleaseDuplicateClasses +> Task :app:extractReleaseNativeSymbolTables +> Task :app:compileReleaseKotlin +> Task :app:mergeExtDexRelease +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies +> Task :app:sdkReleaseDependencyData +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +e: file:///app/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt:167:76 @Composable invocations can only happen from the context of a @Composable function +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:93:69 Variable 'aiResultReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:94:15 Variable 'TAG' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:97:69 Variable 'aiResultStreamReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:98:15 Variable 'TAG' must be initialized + +> Task :app:compileReleaseKotlin FAILED + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 1m 30s +34 actionable tasks: 11 executed, 23 up-to-date diff --git a/build_log_final_retry.txt b/build_log_final_retry.txt new file mode 100644 index 0000000..6bf4e9d --- /dev/null +++ b/build_log_final_retry.txt @@ -0,0 +1,70 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData UP-TO-DATE +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:101:69 Variable 'aiResultReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:102:15 Variable 'TAG' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:105:69 Variable 'aiResultStreamReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:106:15 Variable 'TAG' must be initialized + +> Task :app:compileReleaseKotlin FAILED + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 9s +34 actionable tasks: 2 executed, 32 up-to-date diff --git a/build_log_final_retry_2.txt b/build_log_final_retry_2.txt new file mode 100644 index 0000000..a99f2a4 --- /dev/null +++ b/build_log_final_retry_2.txt @@ -0,0 +1,70 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData UP-TO-DATE +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:101:69 Variable 'aiResultReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:102:15 Variable 'TAG' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:105:69 Variable 'aiResultStreamReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:106:15 Variable 'TAG' must be initialized + +> Task :app:compileReleaseKotlin FAILED + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 8s +34 actionable tasks: 2 executed, 32 up-to-date diff --git a/build_log_final_retry_3.txt b/build_log_final_retry_3.txt new file mode 100644 index 0000000..2661f4b --- /dev/null +++ b/build_log_final_retry_3.txt @@ -0,0 +1,70 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData UP-TO-DATE +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:101:69 Variable 'aiResultReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:102:15 Variable 'TAG' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:105:69 Variable 'aiResultStreamReceiver' must be initialized +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:106:15 Variable 'TAG' must be initialized + +> Task :app:compileReleaseKotlin FAILED + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 7s +34 actionable tasks: 2 executed, 32 up-to-date diff --git a/build_log_final_retry_4.txt b/build_log_final_retry_4.txt new file mode 100644 index 0000000..2dc90e6 --- /dev/null +++ b/build_log_final_retry_4.txt @@ -0,0 +1,69 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData UP-TO-DATE +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:1354:30 Expecting an element +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:1354:32 Unexpected tokens (use ';' to separate expressions on the same line) +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:1354:9 Unresolved reference: currentRetry + +> Task :app:compileReleaseKotlin FAILED + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 6s +34 actionable tasks: 2 executed, 32 up-to-date diff --git a/build_log_final_retry_5.txt b/build_log_final_retry_5.txt new file mode 100644 index 0000000..1eb970b --- /dev/null +++ b/build_log_final_retry_5.txt @@ -0,0 +1,85 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData UP-TO-DATE +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt:791:14 'enablePendingPurchases(): BillingClient.Builder' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MainActivity.kt:1197:5 Parameter 'onDismiss' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt:217:45 Name shadowed: currentModel +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt:388:13 Name shadowed: context +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:50:47 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:246:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:250:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:278:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:280:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:298:12 Unnecessary safe call on a non-null receiver of type Context +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:567:9 Parameter 'selectedImages' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:851:69 Parameter 'retryCount' is never used + +> Task :app:compileReleaseJavaWithJavac +warning: [options] source value 8 is obsolete and will be removed in a future release +warning: [options] target value 8 is obsolete and will be removed in a future release +warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. +3 warnings + +> Task :app:dexBuilderRelease +> Task :app:mergeReleaseGlobalSynthetics UP-TO-DATE +> Task :app:processReleaseJavaRes UP-TO-DATE +> Task :app:mergeReleaseJavaResource +> Task :app:mergeDexRelease +> Task :app:compileReleaseArtProfile +> Task :app:packageRelease +> Task :app:createReleaseApkListingFileRedirect UP-TO-DATE +> Task :app:lintVitalAnalyzeRelease +> Task :app:lintVitalReportRelease +> Task :app:lintVitalRelease +> Task :app:assembleRelease + +BUILD SUCCESSFUL in 52s +46 actionable tasks: 11 executed, 35 up-to-date +INFO: debug.keystore already exists. Skipping generation. +INFO: Signing the APK... +INFO: Build and sign process complete. diff --git a/build_log_final_v6.txt b/build_log_final_v6.txt new file mode 100644 index 0000000..4889e27 --- /dev/null +++ b/build_log_final_v6.txt @@ -0,0 +1,68 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:checkReleaseAarMetadata +> Task :app:mapReleaseSourceSetPaths +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest +> Task :app:processReleaseManifest +> Task :app:mergeReleaseResources +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:checkReleaseDuplicateClasses + +> Task :app:stripReleaseDebugSymbols +Unable to strip the following libraries, packaging them as they are: libimage_processing_util_jni.so, libllm_inference_engine_jni.so. + +> Task :app:processReleaseManifestForPackage +> Task :app:mergeReleaseArtProfile +> Task :app:extractReleaseNativeSymbolTables +> Task :app:processReleaseResources +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:collectReleaseDependencies +> Task :app:sdkReleaseDependencyData +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE +> Task :app:optimizeReleaseResources +> Task :app:mergeExtDexRelease + +> Task :app:compileReleaseKotlin FAILED +e: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:515:45 Val cannot be reassigned + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':app:compileReleaseKotlin'. +> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction + > Compilation error. See log for more details + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +BUILD FAILED in 1m 5s +34 actionable tasks: 18 executed, 16 up-to-date diff --git a/build_log_final_v6_retry.txt b/build_log_final_v6_retry.txt new file mode 100644 index 0000000..ad62e33 --- /dev/null +++ b/build_log_final_v6_retry.txt @@ -0,0 +1,90 @@ +INFO: Starting build and sign process. +INFO: Setting up Android SDK directory... +INFO: Downloading Android SDK... +INFO: Restructuring cmdline-tools... +INFO: Installing SDK packages... +INFO: Building the application... +Configuration on demand is an incubating feature. +> Task :app:buildKotlinToolingMetadata UP-TO-DATE +> Task :app:checkKotlinGradlePluginConfigurationErrors +> Task :app:preBuild UP-TO-DATE +> Task :app:preReleaseBuild UP-TO-DATE +> Task :app:generateReleaseBuildConfig UP-TO-DATE +> Task :app:checkReleaseAarMetadata UP-TO-DATE +> Task :app:generateReleaseResValues UP-TO-DATE +> Task :app:mapReleaseSourceSetPaths UP-TO-DATE +> Task :app:generateReleaseResources UP-TO-DATE +> Task :app:mergeReleaseResources UP-TO-DATE +> Task :app:packageReleaseResources UP-TO-DATE +> Task :app:parseReleaseLocalResources UP-TO-DATE +> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE +> Task :app:extractDeepLinksRelease UP-TO-DATE +> Task :app:processReleaseMainManifest UP-TO-DATE +> Task :app:processReleaseManifest UP-TO-DATE +> Task :app:processReleaseManifestForPackage UP-TO-DATE +> Task :app:processReleaseResources UP-TO-DATE +> Task :app:javaPreCompileRelease UP-TO-DATE +> Task :app:extractProguardFiles UP-TO-DATE +> Task :app:mergeReleaseJniLibFolders UP-TO-DATE +> Task :app:mergeReleaseNativeLibs UP-TO-DATE +> Task :app:stripReleaseDebugSymbols UP-TO-DATE +> Task :app:extractReleaseNativeSymbolTables UP-TO-DATE +> Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE +> Task :app:checkReleaseDuplicateClasses UP-TO-DATE +> Task :app:desugarReleaseFileDependencies UP-TO-DATE +> Task :app:mergeExtDexRelease UP-TO-DATE +> Task :app:mergeReleaseArtProfile UP-TO-DATE +> Task :app:mergeReleaseShaders UP-TO-DATE +> Task :app:compileReleaseShaders NO-SOURCE +> Task :app:generateReleaseAssets UP-TO-DATE +> Task :app:mergeReleaseAssets UP-TO-DATE +> Task :app:compressReleaseAssets UP-TO-DATE +> Task :app:optimizeReleaseResources UP-TO-DATE +> Task :app:collectReleaseDependencies UP-TO-DATE +> Task :app:sdkReleaseDependencyData UP-TO-DATE +> Task :app:writeReleaseAppMetadata UP-TO-DATE +> Task :app:writeReleaseSigningConfigVersions UP-TO-DATE + +> Task :app:compileReleaseKotlin +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt:217:45 Name shadowed: currentModel +w: file:///app/app/src/main/kotlin/com/google/ai/sample/MenuScreen.kt:388:13 Name shadowed: context +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:161:9 Variable 'chatMessages' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:228:17 Variable 'intent' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:232:21 Name shadowed: intent +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:466:76 'Divider(Modifier = ..., Dp = ..., Color = ...): Unit' is deprecated. Renamed to HorizontalDivider +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:536:47 'Send: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.Send +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:753:48 Check for instance is always 'false' +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningScreen.kt:982:5 Parameter 'onSkipAll' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:50:47 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:254:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:258:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:286:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:288:9 'LocalBroadcastManager' is deprecated. Deprecated in Java +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:306:12 Unnecessary safe call on a non-null receiver of type Context +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:575:9 Parameter 'selectedImages' is never used +w: file:///app/app/src/main/kotlin/com/google/ai/sample/feature/multimodal/PhotoReasoningViewModel.kt:859:69 Parameter 'retryCount' is never used + +> Task :app:compileReleaseJavaWithJavac +warning: [options] source value 8 is obsolete and will be removed in a future release +warning: [options] target value 8 is obsolete and will be removed in a future release +warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. +3 warnings + +> Task :app:dexBuilderRelease +> Task :app:mergeReleaseGlobalSynthetics UP-TO-DATE +> Task :app:processReleaseJavaRes UP-TO-DATE +> Task :app:mergeReleaseJavaResource +> Task :app:mergeDexRelease +> Task :app:compileReleaseArtProfile +> Task :app:packageRelease +> Task :app:createReleaseApkListingFileRedirect UP-TO-DATE +> Task :app:lintVitalAnalyzeRelease +> Task :app:lintVitalReportRelease +> Task :app:lintVitalRelease +> Task :app:assembleRelease + +BUILD SUCCESSFUL in 1m 10s +46 actionable tasks: 11 executed, 35 up-to-date +INFO: debug.keystore already exists. Skipping generation. +INFO: Signing the APK... +INFO: Build and sign process complete.