部署成功,但应用程序未在模拟器上运行

问题描述 投票:0回答:1

我正在使用 VS 2019 和 Android SDK API 30。

Android 应用程序的部署成功消息显示在输出窗口中,但在模拟器上看不到该应用程序。

enter image description here

输出日志如下: 输出日志:

            Build started...
            1>------ Build started: Project: Jeevitham, Configuration: Debug Any CPU ------
            ...
            4>Starting deployment to pixel_2_r_11_0_-_api_30 ...
            4>Starting emulator pixel_2_r_11_0_-_api_30 ...
            4>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -verbose -avd pixel_2_r_11_0_-_api_30 -prop monodroid.avdname=pixel_2_r_11_0_-_api_30
            4>Emulator pixel_2_r_11_0_-_api_30 is running.
            4>Deploying to pixel_2_r_11_0_-_api_30 ...
            Build started.
            Project "Jeevitham.Android.csproj" (Install target(s)):
            Found Java SDK version 1.8.0.
            Found Java SDK version 1.8.0.
              PackageName: com.companyname.jeevitham
            Dex Fast Deployment Enabled: False
            MonoAndroid Tools: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\
            Android Platform API level: 30
            TargetFrameworkVersion: v11.0
            Android NDK: 
            Android SDK: C:\Program Files (x86)\Android\android-sdk\
            Android SDK Build Tools: C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.2\
            Java SDK: C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\
            Application Java class: android.app.Application
            Project "Jeevitham.csproj" (GetTargetFrameworks target(s)):
            Done building project "Jeevitham.csproj".
            Project "Jeevitham.csproj" (GetTargetPath target(s)):
            Done building project "Jeevitham.csproj".
            Project "Jeevitham.csproj" (GetNativeManifest target(s)):
            Done building project "Jeevitham.csproj".
            Skipping target "_ResolveLibraryProjectImports" because all output files are up-to-date with respect to the input files.
            ...
            Skipping target "_CompileToDalvik" because all output files are up-to-date with respect to the input files.
            Copying file from "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\obj\Debug\110\android\bin\com.companyname.jeevitham.apk" to "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\bin\Debug\com.companyname.jeevitham.apk".

在输出窗口继续输出日志:

            Creating "obj\Debug\110\android_debug_keystore.flag" because "AlwaysCreate" was specified.
            C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.2\zipalign.exe -p 4 "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\obj\Debug\110\android\bin\com.companyname.jeevitham.apk" "bin\Debug\\com.companyname.jeevitham-Signed.apk" 
            C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\bin\java.exe -jar "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\apksigner.jar" sign --ks "C:\Users\John Mangam\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 30  "z:\mobile\VSPodcast\Jeevitham new\Jeevitham\Jeevitham.Android\bin\Debug\com.companyname.jeevitham-Signed.apk" 
            Signed android package 'bin\Debug\com.companyname.jeevitham-Signed.apk'
            Using cached value from RegisterTaskObject
            Found device: emulator-5554
            Creating "obj\Debug\110\upload.flag" because "AlwaysCreate" was specified.
            Creating directory "obj\.cache\".
            Done building project "Jeevitham.Android.csproj".
            Build succeeded.
            4>Deployment was successful to pixel_2_r_11_0_-_api_30.
            ========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
            ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========              
xamarin xamarin.forms
1个回答
0
投票

我在运行应用程序时没有收到任何错误,APK 已成功构建,没有错误,但它没有部署到设备或模拟器。当我通过scrcpy(屏幕镜像工具)手动安装APK时,出现错误:INSTALL_PARSE_FAILED_NO_CERTIFICATES。

基本上,在我的 Android 构建设置中,我错误地将程序集名称从 ProjectName.Android 更改为 ProjectName

Android Build 设置中,在 Application 选项卡下将 Assembly Name 设置为 ProjectName.Android

Image

© www.soinside.com 2019 - 2024. All rights reserved.