Android的工作室 - 应用程序崩溃的AddThis.jar - "源未找到"信息
我必须使用2007-06-18 SDK的项目。我已经添加了AddThis.jar作为库来我在的Android Studio项目。
I have a project using the AddThis SDK. I have added the AddThis.jar as a library to my project in Android Studio.
当我轻点按钮,发布到Facebook,应用程序崩溃与此日志:
When I tap the button to Post to Facebook, the app crashes with this log:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apploi/com.addthis.ui.activities.ATActivityGroup}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apploi/com.addthis.ui.activities.ATShareActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apploi/com.addthis.ui.activities.ATShareActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2035)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
at com.addthis.ui.activities.ATActivityGroup.showNextView(ATActivityGroup.java:167)
at com.addthis.ui.activities.ATActivityGroup.loadViews(ATActivityGroup.java:99)
at com.addthis.ui.activities.ATActivityGroup.onCreate(ATActivityGroup.java:78)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1123)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2309)
at android.content.res.Resources.getLayout(Resources.java:939)
at android.view.LayoutInflater.inflate(LayoutInflater.java:395)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
at android.app.Activity.setContentView(Activity.java:1929)
at com.addthis.ui.activities.ATShareActivity.onCreate(ATShareActivity.java:66)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2035)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
at com.addthis.ui.activities.ATActivityGroup.showNextView(ATActivityGroup.java:167)
at com.addthis.ui.activities.ATActivityGroup.loadViews(ATActivityGroup.java:99)
at com.addthis.ui.activities.ATActivityGroup.onCreate(ATActivityGroup.java:78)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Connection reset by peer
这是我可以告诉,这条线是说,ATShareActivity有问题。
了java.lang.RuntimeException:无法启动活动ComponentInfo {com.apploi / com.addthis.ui.activities.ATShareActivity}:android.content.res.Resources $ NotFoundException:资源编号为0x0
From what I can tell, this line is saying that the ATShareActivity is having problems.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apploi/com.addthis.ui.activities.ATShareActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0
当我浏览到 AddThis.jar
,然后打开 ATShareActivity
文件(或任何其他文件的jar文件中),会出现一条消息在屏幕说:源未找到的顶部,有一个标题为可点击的链接附加源...
When I navigate into AddThis.jar
and open the ATShareActivity
file (or any other file inside the jar file), a message appears at the top of the screen saying "Sources Not Found", with a clickable link titled Attach Sources...
我打开附加源...
链接,它可以让我选择一个目录,但我不知道我应该在这里做。
I open the Attach Sources...
link and it allows me to select a directory, but I don't know what I am supposed to do here.
任何关于这个想法将不胜AP preciated。
Any ideas about this would be greatly appreciated.
谢谢你的提示。以下是结束了最后的工作:
Thank you for the tips. Here's what ended up finally working:
1)转换2007-06-18到摇篮
文件>导入项目...
来转变 AddThisSDK
来一个摇篮工程。这创造了一个新的项目,我命名为 AddThisGradle
File > Import Project...
to transition AddThisSDK
to a Gradle Project. This created a new project, which I named AddThisGradle
1B)如果您已经有Facebook的SDK安装
打开终端和新的 AddThisGradle
目录中导航到 AddThisGradle /应用/库
Opened Terminal and navigated inside the new AddThisGradle
directory to AddThisGradle/app/libs
用于命令压缩-d addthis0.0.8.jar COM / Facebook的/ *
在终端删除Facebook的文件从 addthis0.0.8.jar
Used command zip -d addthis0.0.8.jar com/facebook/*
in Terminal to delete the Facebook files from addthis0.0.8.jar
回到 Android的工作室
,经检查发现Facebook的目录由 AddThisGradle
Went back to Android Studio
, checked that the Facebook directory disappeared from AddThisGradle
回到我的我的主要项目 Android的工作室
Went back to my my main project in Android Studio
2)添加2007-06-18到项目中
选择文件>在
Android的工作室项目结构
在我的主项目
Selected File > Project Structure
in my main project in Android Studio
$ P $在pssed的 +
左上角的项目结构屏幕。
Pressed the +
in the upper-left of the Project Structure screen.
出现新建模块
屏幕
选择导入现有项目
在新建模块
屏幕
选择 AddThisGradle
为源代码目录
经过了进口
复选框
变更为模块名称
到:前页
点击完成
按钮
等待摇篮重新同步
3)添加依赖关系
回到项目结构
屏幕
选择应用
在项目结构
屏幕左侧列
选择了依赖
设置页
点击 +
按钮依赖
标签屏幕底部的
Click the +
button at the bottom of the Dependencies
tab screen
选择 +> 3模块依赖
在选择模块
窗口
选择了:前页
模块
等待摇篮重新同步
4)继续努力
在这一点上,一切似乎都很好,除了当我试图运行应用程序我得到一个错误,说执行失败的任务:应用程序:dexDebug
。我用的第一个建议,从这个问题到解决我的问题:Gradle执行失败的任务:应用程序:dexDebug与新的Android Studio项目
At this point, everything seemed good except when I tried to run the app I was getting an error that said Execution failed for task ':app:dexDebug’
. I used the first suggestion from this question to fix my problem: Gradle Execution failed for task ':app:dexDebug' with new Android Studio Project