Comments (3)
哥们,能请教一下怎么集成的吗,我怎么安装启动插件一直报插件的main activity没注册.我是按照文档配置的。而且我用测试demo也会报这个错误。
from droidplugin.
运行那个TestPlugin都会报错
FATAL EXCEPTION: main
E/AndroidRuntime(27823): Process: com.example.TestPlugin, PID: 27823
E/AndroidRuntime(27823): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.TestPlugin/com.example.TestPlugin.MyActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.TestPlugin.MyActivity" on path: DexPathList[[zip file "/data/app/com.example.TestPlugin-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.TestPlugin-1, /vendor/lib, /system/lib]]
E/AndroidRuntime(27823): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2122)
E/AndroidRuntime(27823): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/AndroidRuntime(27823): at android.app.ActivityThread.access$800(ActivityThread.java:140)
E/AndroidRuntime(27823): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
E/AndroidRuntime(27823): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(27823): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(27823): at android.app.ActivityThread.main(ActivityThread.java:5143)
E/AndroidRuntime(27823): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(27823): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(27823): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime(27823): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime(27823): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(27823): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.TestPlugin.MyActivity" on path: DexPathList[[zip file "/data/app/com.example.TestPlugin-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.TestPlugin-1, /vendor/lib, /system/lib]]
E/AndroidRuntime(27823): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime(27823): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/AndroidRuntime(27823): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/AndroidRuntime(27823): at android.app.Instrumentation.newActivity(Instrumentation.java:1063)
E/AndroidRuntime(27823): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2113)
E/AndroidRuntime(27823): ... 11 more
from droidplugin.
在公司用demo试了没问题,在家用一样的工程却报找不到类,这类明明是有的,怎么会没找到呢?肯定是配置出问题了。
1.首先,你得保证导入工程不能删除任何东西,这里说明下,一般我导入其他工程出现appcompat_v7\res\values-v23\styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
做法都是把相关的报错xml删掉(因为一般用不到)就行了,但是这样会出现问题,在MyActivity类中继承的ActionBarActivity是从android.support.v7.app.ActionBarActivity import出来的,这就说明不能简单地删除,不然有可能出现You need to use a Theme.AppCompat theme (or descendant) with this activity.之类的错误;
2.后来没生成R文件,但是工程却没有红叉,这时候要看一下控制台的problems页面,发现要修改 android:minSdkVersion="11";
3.由于没找到的MyActivity是继承于ActionBarActivity,而ActionBarActivity从android.support.v7.app.ActionBarActivity import出来的,所以怀疑是v7包导入问题。所以,最最最重要的是,不知道为什么这次导入的工程队v7引用是在Java Build Path里面的导入,这里是一个关键坑!因为这种方式的导入和引用依赖的导入是不一样的概念,这也是这次出错的关键!
4.ok,只要把v7包改成工程依赖,不通过add jars这种方式引用就ok了,相信你们也是这个原因。
from droidplugin.
Related Issues (20)
- 微信登录,调不起微信界面 HOT 1
- 使用jks签名后的apk无法启动,默认debug可以正常启动 HOT 2
- 安装插件后,打开插件activity会出现class not found HOT 1
- 请问一下,可以把一个第三方apk作为插件,免安装启动吗?
- 在demo上可以安装,但启动即崩溃
- 启动奔溃
- 适配Android P空工程插件打开失败
- 7.1.2设备启动崩溃 HOT 1
- 安装apk失败,提示INSTALL_FAILED_CONFLICTING_PROVIDER HOT 1
- 安装插件失败 HOT 1
- Caused by: java.lang.NoSuchMethodException: collectCertificates [class android.content.pm.PackageParser$Package, int] HOT 1
- android9.0启动插件卡住 HOT 5
- Fake system service faile
- com.example.ApiTestcom.example.ApiTest.MyActivity HOT 11
- Unknown calling package name xxx
- 找到一个不太算bug的NPE--望DroidPluginTeam采纳
- is 32-bit instead of 64-bit
- Android10以上有适配了的么
- 输入框无法输入,点击5秒后崩溃。dispatching input event
- 安卓11开始就没有适配了。安卓13的PackageParser的变更,安卓14的PackageUserState变更等也没有适配。哎,还是自力更生,自己适配吧 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from droidplugin.