I am using Cordova 7.0/IONIC 3.20 project and successfully generated Android library file(.aar) to reuse in third party android application. And we have implemented custom Cordova plugin(com.global.banpi.library.ValidatorPage) to interact with native platform.
But while running the third party app after integration getting Class not found exception. Can any one help the cause of the error.
The below is the implementation in third party App:
MainActivity.java
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = intent = new Intent(this, com.sd.app.MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
}
}
build.gradle:
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
flatDir {
dirs 'libs'
}
}
}
dependencies{
implementation files('libs/android-debug.aar')
implementation files('libs/cordova.jar')
implementation fileTree(dir: 'libs', include: ['*.jar, *.aar'])
}
Getting the below error,
java.lang.ClassNotFoundException: com.global.banpi.library.ValidatorPage
2022-02-04 20:43:49.560 23643-23643/com.example.sdkproj W/System.err: at java.lang.Class.classForName(Native Method)
2022-02-04 20:43:49.560 23643-23643/com.example.sdkproj W/System.err: at java.lang.Class.forName(Class.java:454)
2022-02-04 20:43:49.560 23643-23643/com.example.sdkproj W/System.err: at java.lang.Class.forName(Class.java:379)
2022-02-04 20:43:49.560 23643-23643/com.example.sdkproj W/System.err: at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:489)
2022-02-04 20:43:49.560 23643-23643/com.example.sdkproj W/System.err: at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:169)
2022-02-04 20:43:49.560 23643-23643/com.example.sdkproj W/System.err: at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97)
And below is the custom plugin implemented my project: package name -
com.global.banpi.library.ValidatorPage;
And in config.xml,
<feature name="ValidatorPage">
<param name="android-package" value="com.global.banpi.library.ValidatorPage" />
<param name="onload" value="true" />
</feature>
1 post - 1 participant