I'm try using library NCHART3D
My build.gradle
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.android.test3dchart"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile files('libs/NChart3D.jar')
}
and logcat print :
Couldn't load nchart3d from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.android.test3dchart-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.android.test3dchart-2, /vendor/lib, /system/lib]]]: findLibrary returned null
01-15 13:29:50.177 2793-2793/com.example.android.chart D/dalvikvm﹕ Late-enabling CheckJNI
01-15 13:29:50.267 2793-2793/com.example.android.chart W/dalvikvm﹕ Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/nulana/NChart/NChartView;
01-15 13:29:50.267 2793-2793/com.example.android.chart W/dalvikvm﹕ Class init failed in Constructor.constructNative (Lcom/nulana/NChart/NChartView;)
01-15 13:29:50.267 2793-2793/com.example.android.chart D/AndroidRuntime﹕ Shutting down VM
01-15 13:29:50.267 2793-2793/com.example.android.chart W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x415778b0)
01-15 13:29:50.277 2793-2793/com.example.android.chart E/AndroidRuntime﹕ FATAL EXCEPTION: main
UPDATE in xml preview
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.nulana.NChart.NChartView
android:id="@+id/surface"
android:layout_height="fill_parent"
android:layout_width="fill_parent"/>
</LinearLayout>
Rendering Problems The following classes could not be found: - com.nulana.NChart.NChartView (Fix Build Path, Create Class) Tip: Try to build the project.
I guess this because of redundancy, in following code first line already including your jar.
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/NChart3D.jar')
try to remove compile files('libs/NChart3D.jar'), then clean project and rebuild
make sure you have following project structure, and note that your jar should go into libs folder and other lib components in jniLibs. This is for android studio 1.0
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments