小编mar*_*dan的帖子

为什么选择'gradle clean'?

为什么我会运行'gradle clean build'而不是'gradle build'?根据我的理解,gradle可以检测源更改并在需要时更新最终工件.那为什么我还需要'清洁'?

build-system gradle

47
推荐指数
2
解决办法
6万
查看次数

Android数据绑定 - '找不到属性的资源标识符'

我的布局文件:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".MainActivity">

<TextView
      android:text="@string/hello_world"
      android:layout_width="wrap_content"
      app:fontName="Roboto-Regular.ttf"
      android:layout_height="wrap_content"/>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我的绑定适配器方法:

public class FontBinding {

  @BindingAdapter("bind:fontName")
  public static void setFontName(TextView view, @NonNull String fontName) {
    String fontPath = "/fonts/" + fontName;

    Typeface typeface = Typeface.createFromAsset(view.getContext().getAssets(), fontPath);

    view.setTypeface(typeface);
  }
}
Run Code Online (Sandbox Code Playgroud)

我得到的错误:

Error:(8) No resource identifier found for attribute 'fontName' in package 'com.example.databindingproject'
Run Code Online (Sandbox Code Playgroud)

按照https://developer.android.com/tools/data-binding/guide.html中的教程进行操作.我可能做错了什么想法?

data-binding android

33
推荐指数
2
解决办法
9082
查看次数

代码= 53"模拟器验证失败."

自从我尝试运行后更新到XCode 6.2

xcodebuild -project Demo.xcworkspace -scheme Demo clean build test
Run Code Online (Sandbox Code Playgroud)

我总是得到:

iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 
"Simulator verification failed." UserInfo=0x7f82b9e091a0 
{
    NSLocalizedFailureReason=A connection to the simulator verification service could
    not be established., 

    NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with 
    ownership enabled., 

    NSLocalizedDescription=Simulator verification failed.
}
Run Code Online (Sandbox Code Playgroud)

有没有遇到过这个?

截图

xcode xcodebuild ios

20
推荐指数
3
解决办法
7266
查看次数

Android数据绑定无法使用View'android:tag'属性

试图在我的项目中使用新的Android数据绑定,但是在尝试将'android:tag'属性设置为某个自定义变量时出现错误.

我的menu_item.xml文件:

<?xml version="1.0" encoding="utf-8"?>
    <layout xmlns:tools="http://schemas.android.com/tools"
        xmlns:android="http://schemas.android.com/apk/res/android">

    <data>

        <variable
            name="menuItem"
            type="com.example.MenuItem" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:tag="@{menuItem}"
        tools:ignore="UseCompoundDrawables">

        <!--suppress AndroidUnknownAttribute -->
        <ImageView
            android:id="@+id/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:imageResource="@{menuItem.itemType.drawableId}" />

        <TextView
            android:id="@+id/displayName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{menuItem.itemType.displayNameId}" />

    </LinearLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)

我的MenuItem类:

public class MenuItem {

    public final ItemType itemType;

    public MenuItem(ItemType itemType) {
        this.itemType = itemType;
    }

}
Run Code Online (Sandbox Code Playgroud)

MenyItemBinding.java的一部分:

public MenuItemBinding(View root) {
        super(root, 0);
        final Object[] bindings = mapBindings(root, 3, sIncludes, sViewsWithIds);
        this.displayName = (android.widget.TextView) bindings[2];
        this.displayName.setTag(null);
        this.icon = (android.widget.ImageView) bindings[1];
        this.icon.setTag(null); …
Run Code Online (Sandbox Code Playgroud)

data-binding android

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

致命错误:对类使用未实现的初始化程序“init()”

我在混合项目中使用 Realm-Cocoa。有一些令人头疼的问题,但现在我真的陷入困境了。我已经尝试了几件事,但没有任何帮助。这个类编译时没有任何抱怨,但在运行时崩溃:

致命错误:对类“MyApp.Model”使用未实现的初始化程序“init()”

这是课程:

import Foundation
import Realm
import SwiftyJSON


class Model: RLMObject {
    dynamic var contactId: String
    dynamic var userId: String
    dynamic var contactType: String
    dynamic var firstName: String
    dynamic var lastName: String
    dynamic var middleName: String
    dynamic var jobTitle:String
    dynamic var department: String
    dynamic var location: String
    dynamic var serviceName: String
    dynamic var serviceType : String
    dynamic var emails : String
    dynamic var addresses :String
    dynamic var profilePictureSHA1 : String
    dynamic var extNum : String
    dynamic var fqExtNum …
Run Code Online (Sandbox Code Playgroud)

realm swift

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

标签 统计

android ×2

data-binding ×2

build-system ×1

gradle ×1

ios ×1

realm ×1

swift ×1

xcode ×1

xcodebuild ×1