i m working on a project with firebird and android.My code is correct but when i try to run it gives me in logcat a lot of error of runTime:
05-17 09:43:57.394: E/AndroidRuntime(302): FATAL EXCEPTION: main
05-17 09:43:57.394: E/AndroidRuntime(302): java.lang.NoClassDefFoundError: org.firebirdsql.jdbc.FBDataSource
05-17 09:43:57.394: E/AndroidRuntime(302): at org.firebirdsql.jdbc.AbstractDriver.createDataSource(AbstractDriver.java:138)
05-17 09:43:57.394: E/AndroidRuntime(302): at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:124)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.sql.DriverManager.getConnection(DriverManager.java:191)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.sql.DriverManager.getConnection(DriverManager.java:226)
05-17 09:43:57.394: E/AndroidRuntime(302): at com.example.as.MainActivity.onCreate(MainActivity.java:25)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.os.Handler.dispatchMessage(Handler.java:99)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.os.Looper.loop(Looper.java:123)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.lang.reflect.Method.invokeNative(Native Method)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.lang.reflect.Method.invoke(Method.java:521)
05-17 09:43:57.394: E/AndroidRuntime(302): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-17 09:43:57.394: E/AndroidRuntime(302): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-17 09:43:57.394: E/AndroidRuntime(302): at dalvik.system.NativeStart.main(Native Method)
can you help me please?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
what IDE do you use ?
Have you tried the example-project ?
Does the example-project work for you ?
In which folder in your project have you copied the files in the assets folder ?
regards
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
just uploaded a new version of jaybird for android.
I've tested the example-project (although just uploaded) it works.
Which version of java do you use ?
regards
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello friends, I´m here again. I have the following code below in my test project. Could you help me where are my mistakes? I´m using JAYBIRD 2.2.4 and the JDK installed are 1.7. Thanks all for some help.
public class MainActivity extends ActionBarActivity {
privateButtonbtn_conectar,btn_consultar;privateEditTexted_cliente,ed_fone,ed_id;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// Enable screen componentsbtn_conectar=(Button)findViewById(R.id.btn_Conectar);btn_consultar=(Button)findViewById(R.id.btn_Consultar);ed_cliente=(EditText)findViewById(R.id.ed_Cliente);ed_fone=(EditText)findViewById(R.id.ed_Fone);ed_id=(EditText)findViewById(R.id.ed_ID);// Listenersbtn_conectar.setOnClickListener(newView.OnClickListener(){@OverridepublicvoidonClick(Viewview){try{Class.forName("org.firebirdsql.jdbc.FBDriver");Toast.makeText(getApplicationContext(),"DRIVER JDBC FIREBIRD RECONHECIDO",Toast.LENGTH_LONG).show();Connectionconnection=DriverManager.getConnection("jdbc:firebirdsql://SERVIDOR/3050:c:\\Dados\\SIS_PEDIDOS.FDB","SYSDBA","masterkey");}catch(ClassNotFoundExceptione){Toast.makeText(getApplicationContext(),"ERRO DE CLASSE DE DRIVER INEXISTENTE",Toast.LENGTH_LONG).show();System.err.println(e.getMessage());}catch(SQLExceptione){Toast.makeText(getApplicationContext(),"ERRO DE EXCESSÃO DE SQL",Toast.LENGTH_LONG).show();e.printStackTrace();}}});}@OverridepublicbooleanonCreateOptionsMenu(Menumenu){// Inflate the menu; this adds items to the action bar if it is present.getMenuInflater().inflate(R.menu.menu_main,menu);returntrue;}@OverridepublicbooleanonOptionsItemSelected(MenuItemitem){// Handle action bar item clicks here. The action bar will// automatically handle clicks on the Home/Up button, so long// as you specify a parent activity in AndroidManifest.xml.intid=item.getItemId();//noinspection SimplifiableIfStatementif(id==R.id.action_settings){returntrue;}returnsuper.onOptionsItemSelected(item);}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Use Java 1.6 please. The Android platform uses dalvik wich only support a very small set of Java 1.7 so i desided to distribute a java 1.6 compatible libraray only. If you have to use Java 1.7, compile the library by your self.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
i m working on a project with firebird and android.My code is correct but when i try to run it gives me in logcat a lot of error of runTime:
05-17 09:43:57.394: E/AndroidRuntime(302): FATAL EXCEPTION: main
05-17 09:43:57.394: E/AndroidRuntime(302): java.lang.NoClassDefFoundError: org.firebirdsql.jdbc.FBDataSource
05-17 09:43:57.394: E/AndroidRuntime(302): at org.firebirdsql.jdbc.AbstractDriver.createDataSource(AbstractDriver.java:138)
05-17 09:43:57.394: E/AndroidRuntime(302): at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:124)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.sql.DriverManager.getConnection(DriverManager.java:191)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.sql.DriverManager.getConnection(DriverManager.java:226)
05-17 09:43:57.394: E/AndroidRuntime(302): at com.example.as.MainActivity.onCreate(MainActivity.java:25)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.os.Handler.dispatchMessage(Handler.java:99)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.os.Looper.loop(Looper.java:123)
05-17 09:43:57.394: E/AndroidRuntime(302): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.lang.reflect.Method.invokeNative(Native Method)
05-17 09:43:57.394: E/AndroidRuntime(302): at java.lang.reflect.Method.invoke(Method.java:521)
05-17 09:43:57.394: E/AndroidRuntime(302): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-17 09:43:57.394: E/AndroidRuntime(302): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-17 09:43:57.394: E/AndroidRuntime(302): at dalvik.system.NativeStart.main(Native Method)
can you help me please?
Hello hanane,
what IDE do you use ?
Have you tried the example-project ?
Does the example-project work for you ?
In which folder in your project have you copied the files in the assets folder ?
regards
Christian
Hello hanane,
just uploaded a new version of jaybird for android.
I've tested the example-project (although just uploaded) it works.
Which version of java do you use ?
regards
Christian
Hello friends, I´m here again. I have the following code below in my test project. Could you help me where are my mistakes? I´m using JAYBIRD 2.2.4 and the JDK installed are 1.7. Thanks all for some help.
package android_firebird.br.androidfirebird;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import java.sql.*;
public class MainActivity extends ActionBarActivity {
}
Use Java 1.6 please. The Android platform uses dalvik wich only support a very small set of Java 1.7 so i desided to distribute a java 1.6 compatible libraray only. If you have to use Java 1.7, compile the library by your self.
Do you mean change java version in gradle like this ? Or some else?
Last edit: Michal 2016-04-28