我将apklib文件解压缩到maven.It没有在导入时显示任何错误,但在调用使用apklib导入的库函数时我收到错误?
如何修复doe不匹配路径 - 对于库-apklib文件
apklib不包含任何编译的.class文件,那么为什么我会收到此异常 - java.lang.NoClassDefFoundError
。
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/InsertInput.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Join) does not match path
(com/sample/projectFoundation/AndroidSDK/Join.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Join.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Join.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/JoinType) does not match p
ath (com/sample/projectFoundation/AndroidSDK/JoinType.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/JoinType.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/JoinType.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Match) does not match path
(com/sample/projectFoundation/AndroidSDK/Match.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Match.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Match.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/MatchType) does not match
path (com/sample/projectFoundation/AndroidSDK/MatchType.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/MatchType.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/MatchType.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/MetaDataProvider) does not
match path (com/sample/projectFoundation/AndroidSDK/MetaDataProvider.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/MetaDataProvider.clas
s
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/MetaDataProvider.c
lass
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/MetaDataRestProvider) does
not match path (com/sample/projectFoundation/AndroidSDK/MetaDataRestProvider.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/MetaDataRestProvider.
class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/MetaDataRestProvid
er.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/MetaDataService) does not
match path (com/sample/projectFoundation/AndroidSDK/MetaDataService.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/MetaDataService.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/MetaDataService.cl
ass
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Model) does not match path
(com/sample/projectFoundation/AndroidSDK/Model.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Model.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Model.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Operator) does not match p
ath (com/sample/projectFoundation/AndroidSDK/Operator.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Operator.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Operator.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Order) does not match path
(com/sample/projectFoundation/AndroidSDK/Order.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Order.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Order.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/OrderType) does not match
path (com/sample/projectFoundation/AndroidSDK/OrderType.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/OrderType.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/OrderType.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/ParameterType) does not ma
tch path (com/sample/projectFoundation/AndroidSDK/ParameterType.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/ParameterType.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/ParameterType.clas
s
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/projectConstants) does not ma
tch path (com/sample/projectFoundation/AndroidSDK/projectConstants.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/projectConstants.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/projectConstants.clas
s
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/SelectQuery) does not matc
h path (com/sample/projectFoundation/AndroidSDK/SelectQuery.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/SelectQuery.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/SelectQuery.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Table) does not match path
(com/sample/projectFoundation/AndroidSDK/Table.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Table.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Table.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/UpdateDto) does not match
path (com/sample/projectFoundation/AndroidSDK/UpdateDto.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/UpdateDto.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/UpdateDto.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/UpdateInput) does not matc
h path (com/sample/projectFoundation/AndroidSDK/UpdateInput.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/UpdateInput.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/UpdateInput.class
[INFO]
[INFO] trouble processing:
[INFO] class name (com/sample/projectFoundation/AndroidSDK/Utils) does not match path
(com/sample/projectFoundation/AndroidSDK/Utils.class)
[INFO] ...while parsing com/sample/projectFoundation/AndroidSDK/Utils.class
[INFO] ...while processing com/sample/projectFoundation/AndroidSDK/Utils.class
[INFO] 31 warnings
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ AndroidSDKtest ---
[INFO] Building jar: C:\Users\KH9054\workspace\AndroidSDKTest\target\AndroidSDKt
est.jar
[INFO]
[INFO] --- android-maven-plugin:3.5.3:apk (default-apk) @ AndroidSDKtest ---
[INFO] Copying local assets files to combined assets directory.
[INFO] Enabling debug build for apk.
[INFO] C:\Users\KH9054\Downloads\adt-bundle-windows-x86_64-20131030\adt-bundle-w
indows-x86_64-20131030\sdk\platform-tools\aapt.exe [package, -f, -M, C:\Users\KH
9054\workspace\AndroidSDKTest\AndroidManifest.xml, -S, C:\Users\KH9054\workspace
\AndroidSDKTest\res, -S, C:\Users\KH9054\workspace\AndroidSDKTest\target\unpack\
apklibs/com.sample_sampleMobileSalesforce_apklib_3/res, --auto-add-overlay, -A, C:\U
sers\KH9054\workspace\AndroidSDKTest\target\generated-sources\combined-assets\as
sets, -I, C:\Users\KH9054\Downloads\adt-bundle-windows-x86_64-20131030\adt-bundl
e-windows-x86_64-20131030\sdk\platforms\android-19\android.jar, -F, C:\Users\KH9
054\workspace\AndroidSDKTest\target\AndroidSDKtest.ap_, --debug-mode]
[INFO] Add native libraries from C:\Users\KH9054\workspace\AndroidSDKTest\libs
[INFO]
[INFO] --- android-maven-plugin:3.5.3:internal-pre-integration-test (default-int
ernal-pre-integration-test) @ AndroidSDKtest ---
[INFO] Waiting for initial device list from the Android Debug Bridge
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_mydevice_unknown_sdk found.
[INFO] emulator-5554_mydevice_unknown_sdk : Successfully installed C:\Users\KH
9054\workspace\AndroidSDKTest\target\AndroidSDKtest.apk to emulator-5554_mydevic
e_unknown_sdk
[INFO]
[INFO] --- android-maven-plugin:3.5.3:internal-integration-test (default-interna
l-integration-test) @ AndroidSDKtest ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_mydevice_unknown_sdk found.
[INFO] emulator-5554_mydevice_unknown_sdk : Running instrumentation tests in c
om.sample.projectFoundation
[INFO] emulator-5554_mydevice_unknown_sdk : Run started: com.sample.projectFounda
tion, 4 tests:
[INFO] emulator-5554_mydevice_unknown_sdk : Start [1/4]: com.sample.projectFoun
dation.AuthenticateTest#testAuthenticateService
[INFO] emulator-5554_mydevice_unknown_sdk : ERROR:com.sample.projectFoundation.
AuthenticateTest#testAuthenticateService
[INFO] emulator-5554_mydevice_unknown_sdk : java.lang.NoClassDefFoundError
: com.sample.projectFoundation.AndroidSDK.Authenticate
at com.sample.projectFoundation.AuthenticateTest.testAuthenticateService(Authenticate
Test.java:13)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java
:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:17
01)
[INFO] emulator-5554_mydevice_unknown_sdk : End [1/4]: com.sample.projectFounda
tion.AuthenticateTest#testAuthenticateService
[INFO] emulator-5554_mydevice_unknown_sdk : Start [2/4]: com.sample.projectFoun
dation.DataRestProviderTest#testOperations
[INFO] emulator-5554_mydevice_unknown_sdk : ERROR:com.sample.projectFoundation.
DataRestProviderTest#testOperations
[INFO] emulator-5554_mydevice_unknown_sdk : java.lang.NoClassDefFoundError
: com.sample.projectFoundation.AndroidSDK.Authenticate
at com.sample.projectFoundation.DataRestProviderTest.create(DataRestProviderTest.java
:43)
at com.sample.projectFoundation.DataRestProviderTest.testOperations(DataRestProviderT
est.java:165)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java
:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:17
01)
[INFO] emulator-5554_mydevice_unknown_sdk : End [2/4]: com.sample.projectFounda
tion.DataRestProviderTest#testOperations
[INFO] emulator-5554_mydevice_unknown_sdk : Start [3/4]: com.sample.projectFoun
dation.MetaDataRestProviderTest#testGetEntities
[INFO] emulator-5554_mydevice_unknown_sdk : ERROR:com.sample.projectFoundation.
MetaDataRestProviderTest#testGetEntities
[INFO] emulator-5554_mydevice_unknown_sdk : java.lang.NoClassDefFoundError
: com.sample.projectFoundation.AndroidSDK.Authenticate
at com.sample.projectFoundation.MetaDataRestProviderTest.setUp(MetaDataRestProviderTe
st.java:26)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java
:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:17
01)
[INFO] emulator-5554_mydevice_unknown_sdk : End [3/4]: com.sample.projectFounda
tion.MetaDataRestProviderTest#testGetEntities
[INFO] emulator-5554_mydevice_unknown_sdk : Start [4/4]: com.sample.projectFoun
dation.MetaDataRestProviderTest#testGetEntity
[INFO] emulator-5554_mydevice_unknown_sdk : ERROR:com.sample.projectFoundation.
MetaDataRestProviderTest#testGetEntity
[INFO] emulator-5554_mydevice_unknown_sdk : java.lang.NoClassDefFoundError
: com.sample.projectFoundation.AndroidSDK.Authenticate
at com.sample.projectFoundation.MetaDataRestProviderTest.setUp(MetaDataRestProviderTe
st.java:26)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java
:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:17
01)
[INFO] emulator-5554_mydevice_unknown_sdk : End [4/4]: com.sample.projectFounda
tion.MetaDataRestProviderTest#testGetEntity
[INFO] emulator-5554_mydevice_unknown_sdk : Run ended: 345 ms
[ERROR] emulator-5554_mydevice_unknown_sdk : FAILURES!!!
[INFO] Tests run: 4, Failures: 0, Errors: 4
[INFO] emulator-5554_mydevice_unknown_sdk : Report file written to C:\Users\KH
9054\workspace\AndroidSDKTest\target\surefire-reports\TEST-emulator-5554_mydevic
e_unknown_sdk.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.108s
[INFO] Finished at: Mon Feb 03 13:42:33 IST 2014
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.5.3:internal-integration-test (default-internal-integration-t
est) on project AndroidSDKtest: emulator-5554_mydevice_unknown_sdk : Tests fai
led on device. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal c
om.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:internal-
integration-test (default-internal-integration-test) on project AndroidSDKtest:
emulator-5554_mydevice_unknown_sdk : Tests failed on device.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoFailureException: emulator-5554_mydevice_
unknown_sdk : Tests failed on device.
at com.jayway.maven.plugins.android.AbstractInstrumentationMojo$1.doWith
Device(AbstractInstrumentationMojo.java:407)
at com.jayway.maven.plugins.android.ScreenshotServiceWrapper.doWithDevic
e(ScreenshotServiceWrapper.java:56)
at com.jayway.maven.plugins.android.AbstractAndroidMojo$2.runDo(Abstract
AndroidMojo.java:764)
at com.jayway.maven.plugins.android.AbstractAndroidMojo$DoThread.run(Abs
tractAndroidMojo.java:1275)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
C:\Users\KH9054\workspace\AndroidSDKTest>