我需要一个工具来比较2个二进制文件.文件很大.我在互联网上找到的一些免费软件或试用工具不方便用于大文件.你能推荐我任何工具吗?
我已经创建了一个新项目,但是当它完成第一次编译时,新项目会返回一个错误:
Error:Could not find common.jar (android.arch.core:common:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar
Run Code Online (Sandbox Code Playgroud)
我真的不知道如何解决它,希望你能帮助我!
关于我如何创建新项目的屏幕截图:
的build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
setting.gradle
include ':app'
Run Code Online (Sandbox Code Playgroud)
我添加了gradle文件,因为我认为那里存在问题.
新用户无法通过Facebook登录,并收到一条错误消息:“应用程序不可用:您尝试使用的应用程序不再可用或访问受到限制。”。
用户访问他们现有的Facebook帐户没有任何问题。
我正在尝试在 RecyclerView 中的元素顶部添加一个分隔符。
跟随谷歌我已经成功添加了一个DividerItemDecoration,代码如下:
分隔项装饰:
public class DividerItemDecoration extends RecyclerView.ItemDecoration {
private static final int[] ATTRS = new int[]{
android.R.attr.listDivider
};
public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
private Drawable mDivider;
private int mOrientation;
public DividerItemDecoration(Context context, int orientation) {
final TypedArray a = context.obtainStyledAttributes(ATTRS);
mDivider = a.getDrawable(0);
a.recycle();
setOrientation(orientation);
}
public void setOrientation(int orientation) {
if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) {
throw new IllegalArgumentException("invalid orientation");
}
mOrientation = orientation; …
Run Code Online (Sandbox Code Playgroud) 我目前遇到一个错误,该错误继续降低我的应用程序的性能。
该错误不会导致应用程序关闭或崩溃,或者向控制台写入异常。控制台只是简单地报告这个消息:
E/iardini.error0: Invalid ID 0x00000001.
从消息中出现的唯一内容是:
如何复制错误:我在 github 上创建了一个公共存储库,因此您可以下载源代码并享用午餐!您将立即看到错误将显示在控制台内。
错误消息取决于什么?我该如何解决?
提前致谢!
android android-resources android-tablayout android-databinding android-viewpager2
我最近开始使用firebase,并遵循官方指南,为项目添加了一些依赖项才能使用它。这是我添加到新创建的项目中的依赖项:
apply plugin: 'com.google.gms.google-services'
implementation "com.google.firebase:firebase-core:$firebaseCoreVersion"
implementation "com.google.firebase:firebase-auth:$firebaseAuthVersion"
buildscript {
...
ext{
firebaseCoreVersion='17.0.0'
firebaseAuthVersion='18.0.0'
}
}
Run Code Online (Sandbox Code Playgroud)
同步我的项目后,我得到了一个非常糟糕的警告。
WARNING: API 'variant.getMergeResources()' is obsolete
and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
Run Code Online (Sandbox Code Playgroud)
所以,我在gradle.properties中添加了以下代码行,以查看问题所在。
android.debug.obsoleteApi=true
Run Code Online (Sandbox Code Playgroud)
不幸的是,如果我做错了什么,或者我可以做些什么,我从堆栈跟踪中无法理解。
在整个堆栈跟踪下,请先感谢您可以给我的任何评论或答案。
REASON: It is currently called from the following trace:
java.lang.Thread.getStackTrace(Thread.java:1556)
com.android.build.gradle.internal.errors.DeprecationReporterImpl.reportDeprecatedApi(DeprecationReporterImpl.kt:79)
com.android.build.gradle.internal.api.BaseVariantImpl.getMergeResources(BaseVariantImpl.java:349)
com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated.getMergeResources(null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:59)
org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:228)
org.gradle.internal.metaobject.BeanDynamicObject.tryGetProperty(BeanDynamicObject.java:171)
org.gradle.internal.metaobject.CompositeDynamicObject.tryGetProperty(CompositeDynamicObject.java:55)
org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:59)
com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated.getProperty(null:-1)
org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:298)
com.google.gms.googleservices.GoogleServicesPlugin.handleVariant(GoogleServicesPlugin.groovy:164)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479)
org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191)
org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:78)
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:398)
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:338)
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68) …
Run Code Online (Sandbox Code Playgroud) 您好,我在发布版本中遇到了 Gson 库的问题。
实际上,在我的应用程序的发行版本中,使用该new Gson().toJson(obj)
方法会返回错误的字符串。
返回的字符串缺少我的对象的某些字段。发布版本是否可能需要一些缺失的选项?
以下是一些有用的信息:
obj
是一个实例ArrayList<MyClass>
implementation 'com.google.code.gson:gson:2.8.5'
Android Studio 3.5.1
MyClass 的构建如下:
public class MyClass{
@SerializedName("a")
private String a;
@SerializedName("b")
private Integer b;
@SerializedName("c")
private String c;
@SerializedName("d")
private String d;
public String getA() {
return a;
}
public void setA(String a) {
this.a = a;
}
...
}
Run Code Online (Sandbox Code Playgroud)
例子:
MyClass example = new MyClass("a","b","c","d");
ArrayList<MyClass> listExample = new ArrayList<MyClass>();
listExample.add(example);
String strObj = new Gson().toJson(listExample);
Run Code Online (Sandbox Code Playgroud)
电流输出:
[
{
"b":"b", …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在CoordinatorLayout中移动按钮,但效果不佳。
注意:这不是一个晶圆厂按钮!在背景中还有2个以上不可见。还有一个不可见的cardview,在这种情况下,我的fab按钮不在右下角。
我尝试过的事情:我尝试遵循CoordinatorLayout,FAB和容器布局冲突
布局
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/cardview_default_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding_detail_card">
<!-- Nominativo -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_nominativo"
style="@style/AppTheme.NoActionBar.Text.Primary"/>
<!-- Identificativo -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_identificativo"
style="@style/AppTheme.NoActionBar.Text.Primary"/>
<!-- Data -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_data"
style="@style/AppTheme.NoActionBar.Text.Primary"/>
<!-- Indirizzo -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_indirizzo"
style="@style/AppTheme.NoActionBar.Text.Primary" />
<!-- Telefono -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_telefono"
style="@style/AppTheme.NoActionBar.Text.Primary" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent" …
Run Code Online (Sandbox Code Playgroud)