我将Facebook SDK添加到Android studio 0.8.2中 它在代码中没有错误,但在运行应用程序时出现了一些错误。
==========================
Executing tasks: [:app:generateDebugSources, :facebook:generateDebugSources]
Configuration on demand is an incubating feature.
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:facebook:compileLint
:facebook:copyReleaseLint UP-TO-DATE
:facebook:mergeReleaseProguardFiles UP-TO-DATE
:facebook:preBuild
:facebook:preReleaseBuild
:facebook:checkReleaseManifest
:facebook:prepareReleaseDependencies
:facebook:compileReleaseAidl UP-TO-DATE
:facebook:compileReleaseRenderscript UP-TO-DATE
:facebook:generateReleaseBuildConfig UP-TO-DATE
:facebook:generateReleaseAssets UP-TO-DATE
:facebook:mergeReleaseAssets UP-TO-DATE
:facebook:generateReleaseResValues UP-TO-DATE
:facebook:generateReleaseResources UP-TO-DATE
:facebook:packageReleaseResources UP-TO-DATE
:facebook:processReleaseManifest UP-TO-DATE
:facebook:processReleaseResources UP-TO-DATE
:facebook:generateReleaseSources UP-TO-DATE
:facebook:compileReleaseJava
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:21: error: package bolts does not exist
import bolts.AppLink;
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:22: error: package bolts does not exist
import bolts.AppLinkResolver;
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:23: error: package bolts does not exist
import bolts.Continuation;
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:24: error: package bolts does not exist
import bolts.Task;
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:37: error: cannot find symbol
public class FacebookAppLinkResolver implements AppLinkResolver {
^
symbol: class AppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:47: error: cannot find symbol
private final HashMap<Uri, AppLink> cachedAppLinks = new HashMap<Uri, AppLink>();
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:57: error: cannot find symbol
public Task<AppLink> getAppLinkFromUrlInBackground(final Uri uri) {
^
symbol: class Task
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:57: error: cannot find symbol
public Task<AppLink> getAppLinkFromUrlInBackground(final Uri uri) {
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:79: error: cannot find symbol
public Task<Map<Uri, AppLink>> getAppLinkFromUrlsInBackground(List<Uri> uris) {
^
symbol: class Task
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:79: error: cannot find symbol
public Task<Map<Uri, AppLink>> getAppLinkFromUrlsInBackground(List<Uri> uris) {
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:178: error: package AppLink does not exist
private static AppLink.Target getAndroidTargetFromJson(JSONObject targetJson) {
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:47: error: cannot find symbol
private final HashMap<Uri, AppLink> cachedAppLinks = new HashMap<Uri, AppLink>();
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:61: error: cannot find symbol
Task<Map<Uri, AppLink>> resolveTask = getAppLinkFromUrlsInBackground(uris);
^
symbol: class Task
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:61: error: cannot find symbol
Task<Map<Uri, AppLink>> resolveTask = getAppLinkFromUrlsInBackground(uris);
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:63: error: cannot find symbol
return resolveTask.onSuccess(new Continuation<Map<Uri, AppLink>, AppLink>() {
^
symbol: class Continuation
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:63: error: cannot find symbol
return resolveTask.onSuccess(new Continuation<Map<Uri, AppLink>, AppLink>() {
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:63: error: cannot find symbol
return resolveTask.onSuccess(new Continuation<Map<Uri, AppLink>, AppLink>() {
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:80: error: cannot find symbol
final Map<Uri, AppLink> appLinkResults = new HashMap<Uri, AppLink>();
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:80: error: cannot find symbol
final Map<Uri, AppLink> appLinkResults = new HashMap<Uri, AppLink>();
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:85: error: cannot find symbol
AppLink appLink = null;
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:102: error: cannot find symbol
return Task.forResult(appLinkResults);
^
symbol: variable Task
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:105: error: cannot find symbol
final Task<Map<Uri, AppLink>>.TaskCompletionSource taskCompletionSource = Task.create();
^
symbol: class Task
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:105: error: cannot find symbol
final Task<Map<Uri, AppLink>>.TaskCompletionSource taskCompletionSource = Task.create();
^
symbol: class AppLink
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:105: error: cannot find symbol
final Task<Map<Uri, AppLink>>.TaskCompletionSource taskCompletionSource = Task.create();
^
symbol: variable Task
location: class FacebookAppLinkResolver
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:147: error: package AppLink does not exist
List<AppLink.Target> targets = new ArrayList<AppLink.Target>(targetsCount);
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:147: error: package AppLink does not exist
List<AppLink.Target> targets = new ArrayList<AppLink.Target>(targetsCount);
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:150: error: package AppLink does not exist
AppLink.Target target = getAndroidTargetFromJson(rawTargets.getJSONObject(i));
^
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:157: error: cannot find symbol
AppLink appLink = new AppLink(uri, targets, webFallbackUrl);
^
symbol: class AppLink
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:157: error: cannot find symbol
AppLink appLink = new AppLink(uri, targets, webFallbackUrl);
^
symbol: class AppLink
C:\Users\HuuLoc\AndroidStudioProjects\Har\libraries\facebook\src\com\facebook\FacebookAppLinkResolver.java:192: error: package AppLink does not exist
return new AppLink.Target(packageName, className, targetUri, appName);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
30 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':facebook:compileReleaseJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 22.267 secs
=================================
答案 0 :(得分:0)
在你的facebook / build.gradle文件中,更改行
compile files('../libs/bolts.jar')
到这一行
compile files('libs/bolts.jar')