小编Jon*_*las的帖子

appcompat-v7:21.0.0':找不到与给定名称匹配的资源:attr'android:actionModeShareDrawable'

尝试在我的项目中使用最新的appcompat-v7支持库时,出现以下错误:

/Users/greg/dev/mobile/android_project/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/values-v11/values.xml
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Run Code Online (Sandbox Code Playgroud)

我该如何解决?

android gradle xamarin.android android-support-library android-5.0-lollipop

374
推荐指数
6
解决办法
38万
查看次数

如何将MVC 5身份验证添加到Unity IoC?

我正在努力在我的应用程序中实现新的ASP.NET MVC 5开箱即用身份验证.但是当使用Unity作为我的IoC时,我不能使用AccountController的任何部分,因为我给出了错误:

类型IUserStore`1没有可访问的构造函数.

这是我给出的统一设置,在global.asax中调用

public class DependencyConfig
{
    public static void Initialise()
    {
        var container = BuildUnityContainer();

        DependencyResolver.SetResolver(new UnityDependencyResolver(container));
    }

    private static IUnityContainer BuildUnityContainer()
    {
        var container = new UnityContainer();

        // register all your components with the container here
        // it is NOT necessary to register your controllers

        container.RegisterType<IEmployeeRepository, EmployeeRepository>();

        container.RegisterType<ITeamRepository, TeamRepository>();

        container.RegisterType<ICompanyRepository, CompanyRepository>();

        return container;
    }
}
Run Code Online (Sandbox Code Playgroud)

这是新的AccountController.cs的默认构造函数

public AccountController()
        : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new BusinessTrackerUsersContext())))
{

}

public AccountController(UserManager<ApplicationUser> userManager)
{
    UserManager = userManager;
}

public AccountController(UserManager<ApplicationUser> userManager) …
Run Code Online (Sandbox Code Playgroud)

c# asp.net asp.net-mvc asp.net-mvc-5 asp.net-identity

22
推荐指数
2
解决办法
7058
查看次数

如何查看Android Studio中Gradle任务执行的CLI命令?

我正在尝试更好地了解Android Studio在构建Android应用程序时幕后发生的情况.我一直在阅读Gradle,但有一点我无法弄清楚如何查看Gradle调用的相应CLI命令和参数.它似乎是抽象的,没有记录到Gradle ConsoleEvent Log.

我最接近看到Gradle内部发生了什么是AOSP代码.

2.2.2来源:

https://android.googlesource.com/platform/tools/base/+/gradle_2.2.2/build-system/gradle-core/src/main/java/com/android/build/gradle/tasks

目标

我希望能够看到Android Studio中Gradle任务生成的相应CLI命令.

用例示例

我想深入了解Legacy Android Build Process.这包括通过以下内容:

源代码/库代码 - > javac - > Java字节码(.class) - > proguard - >最小化字节码(.class) - > dex - > DEX字节码(.dex)

例如,我希望看到javac调用的相应命令AndroidJavaCompile.https://android.googlesource.com/platform/tools/base/+/gradle_2.2.2/build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/factory/AndroidJavaCompile. java的

我担心这样做的唯一方法是直接查看源代码,甚至直接从源代码构建.

尽职调查

我已经在Google,Android博客,Google I/O会谈,Android书籍等方面进行了大量搜索.我一直无法找到直截了当的答案.

android gradle android-studio android-gradle-plugin

10
推荐指数
1
解决办法
1223
查看次数

解析动态命名的JSON对象的最有效方法是什么?

我正在尝试解析一个JSON响应,其中包含一些我不太熟悉的东西,也没有经常在野外看到过.

在其中一个JSON对象中,有一个动态命名的JSON对象.

在此示例中,"bugs"命名中有一个JSON对象,"12345"它与一个错误号相关联.

{
   "bugs" : {
      "12345" : {
         "comments" : [
            {
               "id" : 1,
               "text" : "Description 1"
            },
            {
               "id" : 2,
               "text" : "Description 2"
            }
         ]
      }
   }
}
Run Code Online (Sandbox Code Playgroud)

我很好奇的是:解析动态命名的JSON对象最有效的方法什么?

给出了一些JSON Utility工具

他们会像上面那样采用JSON响应,并将其变为类似下面的类:

jsonutils

public class Comment
{
    public int id { get; set; }
    public string text { get; set; }
}

public class 12345
{
    public IList<Comment> comments { get; set; }
} …
Run Code Online (Sandbox Code Playgroud)

c# json

5
推荐指数
1
解决办法
771
查看次数

有人能真正解释Resource.Designer.cs的工作原理吗?

我经常在项目构建期间遇到问题,其中Resource.Designer生成但不再编译.我的搜索引擎显示我不是唯一有这个问题的人,但我也没有找到任何可靠的"修复".

例如,现在我有一个工作正常的项目,但是如果我添加对NuGet库(我创建的)的引用,那么应用程序将不再编译,因为Resource.Designer.cs中存在大量错误.

在另一个项目中,我只是升级了Xamarin Forms,现在我再也无法编译了,因为Resource.Designer.cs中出现了大量错误.

当然,最直接的问题是"如何修复这些项目中的错误",但实际上我想了解这里的基本内容.是什么导致Resource.Designer生成和重新生成?使用什么算法来决定将哪些项目放入该文件?为什么我们经常最终得到一个生成的文件然后无法实际编译?为什么没有获得这些项目所需的参考?

我真的很想从根本上理解这一点,这样一旦我越过当前的事情让我头痛,我可以在将来再次出现时避免它(我肯定会再次出现).

android xamarin.android aapt xamarin

1
推荐指数
1
解决办法
3086
查看次数