Adb ошибка 1000

Comments

@pmahend1

@pmahend1
pmahend1

changed the title
error ADB1000: Xamarin.AndroidTools.AndroidDeploymentException: FailedToSynchronizeFastDevAssemblies —> Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission deniedMono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied

error ADB1000: Xamarin.AndroidTools.AndroidDeploymentException: FailedToSynchronizeFastDevAssemblies —> Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied

Sep 23, 2020

dellis1972

added a commit
to dellis1972/xamarin-android
that referenced
this issue

Oct 9, 2020

@dellis1972

Fixes xamarin#5009
Fixes xamarin#5147

The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS which means we can no longer use
the external storage directory to store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the .apk will
mostly not need to be re-installed during a debugging/development
session. Instead the assemblies are "Fast Deployed" to a special
directory where a debug version of our runtime knows where to find
them.

Historically this was on the external storage directory such as

    `/storage/emulated/0/Android/data/com.some.package`
    `/mnt/shell/emulated/0/Android/data/com.some.package`
    `/storage/sdcard/Android/data/com.some.package`

With the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. This
is not a global writable folder, so we need to use the `run-as` tool to
run all the commands to copy the files into that diectory.

The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. If a certain
device does not support the `run-as` tool, then you can always fall back to
debugging without Fast Deployment. While this is slower, it should still work
on most devices.

The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](xamarin@f0d565f). This was becuase it required the use of
depreicated API's to work.

The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. This new system removes
the need for that. All the BCL and API specific assemblies will be deployed to the
`files` directory like all the other assemblies.

The new system is on par with the existing system when it comes to speed. More
improvements are planned in future releases which should make it much quicker.

Using the `samples\HelloWorld` project these are the performance differences
using `HelloWorld.csproj /restore /t:Install /v:n`

Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58

New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43

dellis1972

added a commit
to dellis1972/xamarin-android
that referenced
this issue

Oct 9, 2020

@dellis1972

Fixes xamarin#5009
Fixes xamarin#5147
Fixes xamarin#4996

The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS which means we can no longer use
the external storage directory to store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the .apk will
mostly not need to be re-installed during a debugging/development
session. Instead the assemblies are "Fast Deployed" to a special
directory where a debug version of our runtime knows where to find
them.

Historically this was on the external storage directory such as

    `/storage/emulated/0/Android/data/com.some.package`
    `/mnt/shell/emulated/0/Android/data/com.some.package`
    `/storage/sdcard/Android/data/com.some.package`

With the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. This
is not a global writable folder, so we need to use the `run-as` tool to
run all the commands to copy the files into that diectory.

The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. If a certain
device does not support the `run-as` tool, then you can always fall back to
debugging without Fast Deployment. While this is slower, it should still work
on most devices.

The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](xamarin@f0d565f). This was becuase it required the use of
depreicated API's to work.

The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. This new system removes
the need for that. All the BCL and API specific assemblies will be deployed to the
`files` directory like all the other assemblies.

The new system is on par with the existing system when it comes to speed. More
improvements are planned in future releases which should make it much quicker.

Using the `samples\HelloWorld` project these are the performance differences
using `HelloWorld.csproj /restore /t:Install /v:n`

Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58

New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43

dellis1972

added a commit
to dellis1972/xamarin-android
that referenced
this issue

Oct 9, 2020

@dellis1972

Fixes xamarin#5009
Fixes xamarin#5147
Fixes xamarin#4996

The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS which means we can no longer use
the external storage directory to store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the .apk will
mostly not need to be re-installed during a debugging/development
session. Instead the assemblies are "Fast Deployed" to a special
directory where a debug version of our runtime knows where to find
them.

Historically this was on the external storage directory such as

    `/storage/emulated/0/Android/data/com.some.package`
    `/mnt/shell/emulated/0/Android/data/com.some.package`
    `/storage/sdcard/Android/data/com.some.package`

With the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. This
is not a global writable folder, so we need to use the `run-as` tool to
run all the commands to copy the files into that diectory.

The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. If a certain
device does not support the `run-as` tool, then you can always fall back to
debugging without Fast Deployment. While this is slower, it should still work
on most devices.

The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](xamarin@f0d565f). This was becuase it required the use of
depreicated API's to work.

The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. This new system removes
the need for that. All the BCL and API specific assemblies will be deployed to the
`files` directory like all the other assemblies.

The new system is on par with the existing system when it comes to speed. More
improvements are planned in future releases which should make it much quicker.

Using the `samples\HelloWorld` project these are the performance differences
using `HelloWorld.csproj /restore /t:Install /v:n`

Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58

New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43

dellis1972

added a commit
to dellis1972/xamarin-android
that referenced
this issue

Oct 12, 2020

@dellis1972

Fixes xamarin#5009
Fixes xamarin#5147
Fixes xamarin#4996

The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS which means we can no longer use
the external storage directory to store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the .apk will
mostly not need to be re-installed during a debugging/development
session. Instead the assemblies are "Fast Deployed" to a special
directory where a debug version of our runtime knows where to find
them.

Historically this was on the external storage directory such as

    `/storage/emulated/0/Android/data/com.some.package`
    `/mnt/shell/emulated/0/Android/data/com.some.package`
    `/storage/sdcard/Android/data/com.some.package`

With the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. This
is not a global writable folder, so we need to use the `run-as` tool to
run all the commands to copy the files into that diectory.

The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. If a certain
device does not support the `run-as` tool, then you can always fall back to
debugging without Fast Deployment. While this is slower, it should still work
on most devices.

The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](xamarin@f0d565f). This was becuase it required the use of
depreicated API's to work.

The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. This new system removes
the need for that. All the BCL and API specific assemblies will be deployed to the
`files` directory like all the other assemblies.

The new system is on par with the existing system when it comes to speed. More
improvements are planned in future releases which should make it much quicker.

Using the `samples\HelloWorld` project these are the performance differences
using `HelloWorld.csproj /restore /t:Install /v:n`

Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58

New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43

dellis1972

added a commit
to dellis1972/xamarin-android
that referenced
this issue

Oct 12, 2020

@dellis1972

Fixes xamarin#5009
Fixes xamarin#5147
Fixes xamarin#4996

The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS which means we can no longer use
the external storage directory to store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the .apk will
mostly not need to be re-installed during a debugging/development
session. Instead the assemblies are "Fast Deployed" to a special
directory where a debug version of our runtime knows where to find
them.

Historically this was on the external storage directory such as

    `/storage/emulated/0/Android/data/com.some.package`
    `/mnt/shell/emulated/0/Android/data/com.some.package`
    `/storage/sdcard/Android/data/com.some.package`

With the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. This
is not a global writable folder, so we need to use the `run-as` tool to
run all the commands to copy the files into that diectory.

The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. If a certain
device does not support the `run-as` tool, then you can always fall back to
debugging without Fast Deployment. While this is slower, it should still work
on most devices.

The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](xamarin@f0d565f). This was becuase it required the use of
depreicated API's to work.

The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. This new system removes
the need for that. All the BCL and API specific assemblies will be deployed to the
`files` directory like all the other assemblies.

The new system is on par with the existing system when it comes to speed. More
improvements are planned in future releases which should make it much quicker.

Using the `samples\HelloWorld` project these are the performance differences
using `HelloWorld.csproj /restore /t:Install /v:n`

Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58

New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43

dellis1972

added a commit
to dellis1972/xamarin-android
that referenced
this issue

Oct 12, 2020

@dellis1972

Fixes xamarin#5009
Fixes xamarin#5147
Fixes xamarin#4996

The Fast Deployment system used for debugging Xamarin.Android
apps has been completely re-written. This is mostly due to
changes in the android OS which means we can no longer use
the external storage directory to store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk. This means the .apk will
mostly not need to be re-installed during a debugging/development
session. Instead the assemblies are "Fast Deployed" to a special
directory where a debug version of our runtime knows where to find
them.

Historically this was on the external storage directory such as

    `/storage/emulated/0/Android/data/com.some.package`
    `/mnt/shell/emulated/0/Android/data/com.some.package`
    `/storage/sdcard/Android/data/com.some.package`

With the advent of Android 11, these directories are no longer accessable.
So instead we need to deploy the assemblies into the app internal `files`
directory. This is usually located in `/data/data/com.some.package`. This
is not a global writable folder, so we need to use the `run-as` tool to
run all the commands to copy the files into that diectory.

The `run-as` tool does not always work on older devices. So from this point on
Fast Deployment will only be available on API 21 devices or newer. If a certain
device does not support the `run-as` tool, then you can always fall back to
debugging without Fast Deployment. While this is slower, it should still work
on most devices.

The [Enhanced Fast Deployment](~/android/deploy-test/building-apps/build-properties.md#AndroidFastDeploymentType) mode is still available with this new system.
This will deploy both assemblies, native libraries, typemaps and dexes to the `files`
directory. Support for Fast Deploying resources and assets via that system was
removed in commit [f0d565f](xamarin@f0d565f). This was becuase it required the use of
depreicated API's to work.

The Shared Runtime has also be removed in this new system. Before we used to deploy
the BCL and API specific assemblies via seperate .apks. This new system removes
the need for that. All the BCL and API specific assemblies will be deployed to the
`files` directory like all the other assemblies.

The new system is on par with the existing system when it comes to speed. More
improvements are planned in future releases which should make it much quicker.

Using the `samples\HelloWorld` project these are the performance differences
using `HelloWorld.csproj /restore /t:Install /v:n`

Old From Clean Time Elapsed 00:00:11.42
Old C# Change Time Elapsed 00:00:02.58

New From Clean Time Elapsed 00:00:11.78
New C# Change Time Elapsed 00:00:02.43

jonpryor

pushed a commit
that referenced
this issue

Oct 12, 2020

@dellis1972

Fixes: #4996
Fixes: #5009
Fixes: #5147

Changes: xamarin/monodroid@1ac5333...767f647

  * xamarin/monodroid@767f64715: [msbuild] Fast Deployment v2.0 (#1090)
  * xamarin/monodroid@0f04ba56d: Merge pull request #1115 from xamarin/remove-xreitem
  * xamarin/monodroid@d75341fc3: Remove provisionator file completely
  * xamarin/monodroid@b62e8c693: Replace XreItem with supported Xcode and JavaJDK syntax

The Fast Deployment system used for debugging Xamarin.Android apps has
been completely re-written.  This is mostly due to changes in Android
which means we can no longer use the external storage directory to
store assemblies.

Fast Deployment works by not including files which change often,
like assemblies, in the actual apk.  This means the `.apk` will mostly
not need to be re-installed during a debugging/development session.
Instead the assemblies are "Fast Deployed" to a special directory where
a debug version of our runtime knows where to find them.

Historically this was on the external storage directory such as

	/storage/emulated/0/Android/data/com.some.package
	/mnt/shell/emulated/0/Android/data/com.some.package
	/storage/sdcard/Android/data/com.some.package

With Android 11, these directories are no longer accessible.  Instead,
we need to deploy the assemblies into the app's internal `files`
directory.  This is usually located in `/data/data/@PACKAGE_NAME@`.
This is not a global writable folder, so we need to use the `run-as`
tool to run all the commands to copy the files into that directory.

The `run-as` tool does not always work on older devices.  From this
point on Fast Deployment v2 will only be available on API-21+ devices.
If a certain device does not support the `run-as` tool, then you can
always fall back to debugging without Fast Deployment.  While this is
slower, it should still work on most devices.

[`$(AndroidFastDeploymentType)`][0] is still supported.  This will
deploy both assemblies, native libraries, typemaps, and `.dex` files to
the `files` directory.  Support for Fast Deploying Android resources
and assets was removed in commit f0d565f, as it required the use of
deprecated API's to work.

The Shared Runtime has also be removed in this new system.  Previously,
we used to deploy the BCL and API specific assemblies via separate
`.apk` files.  This new system removes the need for that.  All the BCL
and API specific assemblies will be deployed to the `files` directory
like all the other assemblies.

The new system is on par with the existing system when it comes to
speed.  More improvements are planned in future releases which should
make it much quicker.

Using the `samples\HelloWorld` project these are the performance
differences using `HelloWorld.csproj /restore /t:Install /v:n`:

  * Deploy "from Clean"
    * v1: 00:00:11.42
    * v2: 00:00:11.78 [3% longer]
  * Incrementally deploy C#-based change
    * v1: 00:00:02.58
    * v2: 00:00:02.43 [6% faster]

[0]: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidfastdeploymenttype

@msftbot
msftbot
bot

locked as resolved and limited conversation to collaborators

Jun 3, 2022

So, the first time I got this error I thought I accidently edited a critical system file, so I re-installed the Android SDK and the emulator which fixed the issue.

But now I’m getting the same error. The last thing I did was implement this code

            mainListView.ItemClick += MainListView_ItemClick;

        private void MainListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            throw new NotImplementedException();
        }

And the weird thing is that NONE of my xamarian.android projects run. Literally one moment it was working fine and the next for no obvious reason xamarian.android doesn’t work anymore.

The error is:

«Severity Code Description Project File Line Suppression State
Error ADB1000: System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at Mono.AndroidTools.AndroidInstalledPackage..ctor(String value) in E:\A_work\254\s\External\androidtools\Mono.AndroidTools\AndroidInstalledPackage.cs:line 55
at Mono.AndroidTools.Internal.AdbOutputParsing.ParseLastResortPackageList(String output) in E:\A_work\254\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 65
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass68_0.b__0(Task1 t) in E:\A\_work\254\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 467
at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()
at System.Threading.Tasks.Task.Execute() 0
«

and

«Severity Code Description Project File Line Suppression State
Error ADB1000: Deployment failed
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at Mono.AndroidTools.AndroidInstalledPackage..ctor(String value) in E:\A_work\254\s\External\androidtools\Mono.AndroidTools\AndroidInstalledPackage.cs:line 55
at Mono.AndroidTools.Internal.AdbOutputParsing.ParseLastResortPackageList(String output) in E:\A_work\254\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 65
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass68_0.b__0(Task1 t) in E:\A\_work\254\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 467
at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()
at System.Threading.Tasks.Task.Execute() 0
«

I appreciate your help

  • Remove From My Forums
  • Question

  • User396121 posted

    I am trying to debug an Android application in VS 2019 for Mac using the default Android emulator. The application builds successfully, but then the deployment on the emulator fails with the following error:

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: Deployment failed /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: System.InvalidOperationException: ‘/Users/vesi90/Library/Developer/Xamarin/jdk/microsoftdistopenjdk1.8.0.25/bin/jarsigner’ exited with code ‘1’: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.PlatformPackage.Exec (System.String step, System.Diagnostics.ProcessStartInfo psi, Xamarin.AndroidTools.IProgressNotifier progressReporter, System.Threading.CancellationToken token) [0x0007d] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/PlatformPackage.cs:237 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.PlatformPackage.Jarsigner (System.String unsigned, System.String packageDir, Xamarin.AndroidTools.IProgressNotifier progressReporter, System.Threading.CancellationToken token) [0x00057] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/PlatformPackage.cs:259 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.PlatformPackage.GetPlatformPackagePath (System.Int32 apiLevel, System.String aaptPath, Xamarin.AndroidTools.IProgressNotifier progressReporter, System.Threading.CancellationToken token) [0x00158] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/PlatformPackage.cs:127 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.AndroidDeploySession.InstallSharedPlatformAsync () [0x00080] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:345 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.AndroidDeploySession.EnsureCorrectSharedRuntimes () [0x0017d] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:266 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.AndroidDeploySession.RunAsync (System.Threading.CancellationToken token) [0x001f9] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:194 /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(616,2): error ADB1000: at Xamarin.AndroidTools.AndroidDeploySession.RunLoggedAsync (System.Threading.CancellationToken token) [0x0002f] in /Users/builder/azdo/work/204/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:119 1 Warning 1 Error

    I have installed the Android SDK ver. 9.0. and all the tools for Android development in the installation of VS for Mac. The app is built with Xamarin. The app builds successfully on other Mac’s and PC and it’s verified that it works.

    Please let me know why it fails to deploy using ADB on the emulator.

Answers

  • User379860 posted

    You can use following workaround to test it, if it works.

    1. Create a File > New > Project > Android App (Xamarin) project.
    2. Deploy and run the new project on a device or emulator in the Debug configuration.
    3. After the new app starts running successfully, you can go back to your original project and it should now deploy and run successfully.
    • Marked as answer by

      Thursday, June 3, 2021 12:00 AM

Suddenly, a project was re -built, and the Android emulator was directly selected. Click the deployment. So after waiting for a long time, opening the simulation device slowed down. The deployment became slower, and the CPU sounded directly, and the temperature was over 80 degrees instantly. Then the emulator was opened, but it was always a black screen.

Then there is an error.

Error content:

Error Adb1000: System.io.filenotFoundexception: I failed to find the file "E: \ VSProject \ MAUIAPP3 \ MAUIAPP3 \ bin \ debug \ net6.0-android\com.companyname.mauiapp3-Signed.apk”。
 File name: "E: \ VSProject \ MaUIAPP3 \ Mauiapp3 \ Bin \ Debug \ Net6.0-android\com.companyname.mauiapp3-Signed.apk”
 In System.io .__ ERROR.WINIOERROR (Int32 ErrorCode, String MaybefulPath)
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) 
 In System.io.Filestream..CTOR (String Path, Filemode Mode, FileAccess Access, Fileshare Share)
......

ANDAS0000: WARNING: All illegal access operations will be denied in a future release 0

ANDAS0000: WARNING: Illegal reflective access by com.xxx.xxx.xxxx.xxx (file:C:/Program Files (x86)/xxx/xxx/xxx/xxxx/xxxx.jar) to field sun.instrument.InstrumentationImpl.mNativeAgent 0

ANDAS0000: WARNING: An illegal reflective access operation has occurred 0

......

There are too many content, omitting directly

Main situation:

Error: ADB1000

What happened:

Deploy an error

Simulator black screen

View \ debug \ xxx-Android directory, no xxx-signed.apk is generated. Only one xxx.apk is generated

Solution:

Turn off antivirus software

Trying to deploy a Xamarin Android App to an emulator running on a Mac fails with error «Deployment Failed» along with Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied

Update: The emulator was started by Android Studio. When I try to start the emulator from Visual Studio Mac, I get error

PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/Users/myname/Library/Developer/Xamarin/android-sdk-macosx]!

Below is an excerpt from the Deploying To Device pad round about where the errors start showing

...
Synchronizing assemblies
    Synchronizing assemblies...
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:  Deployment failed
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000: Xamarin.AndroidTools.AndroidDeploymentException: FailedToSynchronizeFastDevAssemblies ---> Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError (System.Threading.CancellationToken token) [0x0002a] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Util/AggregateAsyncResult.cs:72 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Mono.AndroidTools.Adb.AdbSyncClient.EndPushSyncItems (System.IAsyncResult result) [0x00006] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Adb/AdbSyncClient.cs:1071 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Mono.AndroidTools.Internal.AdbClientTaskExtensions.InnerInvoke (System.Threading.Tasks.TaskCompletionSource`1[TResult] tcs, System.Func`2[T,TResult] endMethod, System.IAsyncResult l) [0x00000] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Internal/AdbClientTaskExtensions.cs:256 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000: --- End of stack trace from previous location where exception was thrown ---
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000: 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies (System.String destinationPath, System.Threading.CancellationToken token) [0x00339] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:614 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:    --- End of inner exception stack trace ---
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies (System.String destinationPath, System.Threading.CancellationToken token) [0x003b5] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:622 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Xamarin.AndroidTools.AndroidDeploySession.FastDevAsync (System.Boolean useExternal) [0x000da] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:514 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Xamarin.AndroidTools.AndroidDeploySession.RunAsync (System.Threading.CancellationToken token) [0x004b0] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:229 
        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(618,2): error ADB1000:   at Xamarin.AndroidTools.AndroidDeploySession.RunLoggedAsync (System.Threading.CancellationToken token) [0x0002f] in /Users/builder/azdo/_work/287/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Sessions/AndroidDeploySession.cs:123 
    Done building target "_Upload" in project "xamarinwrapper.csproj" -- FAILED.
    
    Done building project "xamarinwrapper.csproj" -- FAILED.
    
    Build FAILED.
    ...

enter image description here

Понравилась статья? Поделить с друзьями:
  • Adb exe ошибка при запуске приложения 0xc0000005
  • Acrocef exe ошибка приложения 0xc0000142
  • Adast ошибка f40
  • Acrodist exe системная ошибка
  • Aclayers dll ошибка