Skip to content

Commit 0283afe

Browse files
committed
修复插件Build.gradle脚本错误
1 parent 22527e2 commit 0283afe

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

PluginCore/src/com/plugin/core/PluginLoader.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ public static Class loadPluginClassByName(String clazzName) {
249249
e.printStackTrace();
250250
} catch (java.lang.IllegalAccessError illegalAccessError) {
251251
illegalAccessError.printStackTrace();
252+
throw new IllegalAccessError("出现这个异常最大的可能是插件dex和" +
253+
"宿主dex包含了相同的class导致冲突, " +
254+
"请检查插件的编译脚本,确保排除了所有公共依赖库的jar");
252255
}
253256

254257
}

PluginMain/AndroidManifest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818

1919
<!-- plugin Begin -->
2020
<activity
21-
android:name="com.plugin.core.ui.PluginNormalFragmentActivity"
22-
android:exported="true" >
21+
android:name="com.plugin.core.ui.PluginNormalFragmentActivity" >
2322
</activity>
2423

2524
<activity
26-
android:name="com.plugin.core.ui.stub.PluginStubActivity"
27-
android:exported="true" >
25+
android:name="com.plugin.core.ui.stub.PluginStubActivity">
2826
</activity>
2927

3028
<service android:name="com.plugin.core.proxy.PluginProxyService">
-334 KB
Binary file not shown.

PluginTest/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,22 @@ android {
6464
}
6565

6666
dependencies {
67-
//compile 'com.android.support:appcompat-v7:23.0.0'
67+
6868
compile fileTree(dir: 'libs', include: ['*.jar'])
6969

7070
//依赖库的R
7171
provided files(project(':PluginShareLib').getBuildDir().absolutePath + '/outputs/rClasses.jar')
7272
//依赖库的src
7373
provided files(project(':PluginShareLib').getBuildDir().absolutePath + '/intermediates/bundles/release/classes.jar')
74+
//依赖库的依赖裤
75+
provided files(project(':PluginShareLib').getBuildDir().absolutePath + '/intermediates/bundles/release/libs/android-support-v4.jar')
76+
7477
//依赖库的src
7578
provided files(project(':PluginCore').getBuildDir().absolutePath + '/intermediates/bundles/release/classes.jar')
7679

80+
//compile 'com.android.support:appcompat-v7:23.0.0'
81+
//provided('com.android.support:appcompat-v7:23.0.0')
82+
7783
//如果插件需要依赖一些私有库,可放开下面的注释,并修改为私有库的名称
7884
//compile project(':PluginPrivateLib1')
7985
//compile project(':PluginPrivateLib2')
-972 KB
Binary file not shown.

0 commit comments

Comments
 (0)