因此,我正在创建一个使用此库的示例项目https://github.com/OmerUygurOzer/Knit(我创建的东西)。
问题是测试无法用它运行。不知道为什么。该应用程序本身运行良好。但是当我运行测试时,它就在Knit.init(this);Application 类内部调用的行上出错了。
这是日志猫
02-13 20:46:20.471 23727-23727/com.omerozer.knitmvpexample W/System.err: java.lang.NoSuchMethodException: <init> [interface com.omerozer.knit.InternalModel]
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at java.lang.Class.getConstructor(Class.java:531)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at java.lang.Class.getConstructor(Class.java:495)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at com.omerozer.knit.KnitClassLoader.getViewToPresenterConstructor(KnitClassLoader.java:64)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at com.omerozer.knit.KnitClassLoader.getViewToPresenterMap(KnitClassLoader.java:79)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at com.omerozer.knit.KnitClassLoader.<init>(KnitClassLoader.java:23)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at com.omerozer.knit.Knit.init(Knit.java:28)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at com.omerozer.knitmvpexample.MVPApp.onCreate(MVPApp.java:16)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at android.support.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:382)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
02-13 20:46:20.472 23727-23727/com.omerozer.knitmvpexample W/System.err: …Run Code Online (Sandbox Code Playgroud) 每次我尝试使用 Google API 登录时,都会收到以下错误。我的清单具有适当的权限,并且我确实相应地创建了我的凭据。所以我不知道问题是什么。同意屏幕也不会显示。
\n\ncom.omer.notetoself D/NTS:\xef\xb9\x95 ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{3678d5c: android.os.BinderProxy@19bcbe30}, message=null}\nRun Code Online (Sandbox Code Playgroud)\n\n package com.omer.notetoself;\n\n import android.app.Activity;\n import android.content.Intent;\n import android.content.IntentSender;\n import android.os.Bundle;\n import android.util.Log;\n import android.view.Menu;\n import android.view.MenuItem;\n import android.view.View;\n import android.widget.Button;\n import android.widget.EditText;\n\n import com.google.android.gms.common.ConnectionResult;\n import com.google.android.gms.common.Scopes;\n import com.google.android.gms.common.api.GoogleApiClient;\n import com.google.android.gms.common.api.Scope;\n import com.google.android.gms.plus.Plus;\n\n\n `public class Activity_Login extends Activity implements View.OnClickListener,GoogleApiClient.ConnectionCallbacks,\n GoogleApiClient.OnConnectionFailedListener{` \n\n\n private static final int RC_SIGN_IN = 0;\n private GoogleApiClient mGoogleApiClient;\n /* Is there a ConnectionResult resolution in progress? */\n private boolean mIsResolving = false;\n\n /* Should …Run Code Online (Sandbox Code Playgroud) 这个问题只是为了对这些概念有一些想法,以了解行业中人们将这些概念用于什么。
如果您可以仅给出一些示例用法,我将不胜感激。我知道它们的工作原理,并确实阅读了有关它们的google文档,但我似乎仍然很难选择一个。我不需要您向我解释它们如何工作。我只是在询问他们的一些示例用途。您最终如何将它们合并到您的应用程序中,以及为什么选择它们而不是其他应用程序。
谢谢