Recent

Author Topic: Android Module Wizard  (Read 705627 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android Module Wizard
« Reply #600 on: August 29, 2015, 05:39:44 pm »
/usr/bin/ld: cannot find -lGL
libGL is part of your OpenGL capable graphics card driver. You need to install the respective development package.

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #601 on: August 29, 2015, 05:47:18 pm »
Hey guys, here is what I think is the reason of my problem:

http://stackoverflow.com/questions/14495242/android-fatal-signal-11-sigsegv-at-0x00000040-code-1-error

If you look at the answer instead of the question as I did, you may came to the same conclusion I had: the two problems have the same reason, but I could be wrong. So please help me to find an answer.

All error 11-sigsev related with my code was caused by accessing empty array or using a cursor after a malformed sql query.
Are you sure that Strings['data_a'] and Strings['data_2'] are valid and reachable?

s:= vja.Objects.Strings['data_a']+' - '+vja.Objects.Strings['data_2'];

Try to use variable as arry index instead of string

Code: [Select]
const DATA_A = 'data_a';
DATA_2 = 'data2';
s:= vja.Objects[i].Strings[DATA_A]+' - '+vja.Objects[i].Strings[DATA_2];

for me was a solution many times
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #602 on: August 29, 2015, 06:43:00 pm »
Thanks you're an angel. Really I want to create a virtual machine (virtualbox) with Lubuntu (latest version - 15.4) in order to release it to those wishing to try download without exhausting in preparing the car.
Thank you! I'm trying install LAMW in a fresh lubuntu virtual machine too, but I have problems in preparing lazarus deb package, the error is:

(9022) Compiling resource ../units/i386-linux/gtk2/lazarus.or
/home/renabor/tmp/lazarus1.5.49563/lazarus_build/usr/share/lazarus/1.5.49563/ide/lazarus.pp(144,1) Error: (9030) Can't call the resource compiler "/usr/bin/fpcres", switching to external mode
/home/renabor/tmp/lazarus1.5.49563/lazarus_build/usr/share/lazarus/1.5.49563/ide/lazarus.pp(144,1) Warning: (9034) "crti.o" not found, this will probably cause a linking failure
/home/renabor/tmp/lazarus1.5.49563/lazarus_build/usr/share/lazarus/1.5.49563/ide/lazarus.pp(144,1) Warning: (9034) "crtn.o" not found, this will probably cause a linking failure
/home/renabor/tmp/lazarus1.5.49563/lazarus_build/usr/share/lazarus/1.5.49563/ide/lazarus.pp(144,1) Fatal: (10026) There were 1 errors compiling module, stopping

revisions of fpc and lazarus are retrieved with:

svn co -r 49563 http://svn.freepascal.org/svn/lazarus/trunk lazarus
svn co -r 31226 http://svn.freepascal.org/svn/fpc/trunk fpc

/usr/bin/fpcres is still present in my system, but not used, why?!?
Have you had better result?

Hello , I went addition , the preparation of the deb package of Lazarus had no problems . I have no problem about this command because you did not specify from which folder I launch

make clean crossall OS_TARGET=android CPU_TARGET=arm

~/Android/fpc?!

Yes, you execute the command from ~/Android/fpc

but just before you MUST create following symlinks:

Code: [Select]
(CMD) cd /usr/bin
(CMD) sudo ln -s /home/$HOME/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as
(CMD) sudo ln -s /home/$HOME/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld.bfd
(CMD) sudo ln -s /usr/bin/arm-linux-androideabi-as arm-linux-as
(CMD) sudo ln -s /usr/bin/arm-linux-androideabi-ld arm-linux-ld

N.B. if you use reference to 4.8 here, you must ensure to use reference to 4.8 everywhere when configuring LAMW
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #603 on: August 29, 2015, 06:51:55 pm »
/usr/bin/ld: cannot find -lGL
libGL is part of your OpenGL capable graphics card driver. You need to install the respective development package.
Thank you :)
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #604 on: August 29, 2015, 06:56:02 pm »
I installed all of a VM Lubuntu . Now I have a problem in compiling the demo , it gives me these errors . Why?!

Code: [Select]
.
.
.
Compila il progetto, OS: android, CPU: arm, Destinazione: /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/libs/armeabi/libcontrols.so.so: Codice di uscita 256, Errori: 4, suggerimenti: 3
unit1.pas(9,22) Hint: Unit "And_jni" not used in unit1
unit1.pas(9,31) Hint: Unit "And_jni_Bridge" not used in unit1
unit1.pas(10,5) Hint: Unit "Laz_And_Controls_Events" not used in unit1
controls.lpr(335,3) Error: Identifier not found "Java_Event_pOnBluetoothClientSocketIncomingMessage"
controls.lpr(343,3) Error: Identifier not found "Java_Event_pOnBluetoothClientSocketWritingMessage"
controls.lpr(359,3) Error: Identifier not found "Java_Event_pOnBluetoothServerSocketIncomingMessage"
controls.lpr(367,3) Error: Identifier not found "Java_Event_pOnBluetoothServerSocketWritingMessage"
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #605 on: August 29, 2015, 07:06:09 pm »
@xinyiman

from "readme.txt":

special note:
Quote
   *5.PANIC ? [upgrade your project [or demo] code templates!] !
   *   Lazarus IDE --> menu Tools --> [Lamw] Android Module Wizard --> Upgrade code Templates [*.lpr, *.java]


Quote
   *How to use [projects] demos :
   *
   *1. Open the lazarus project "controls.lpi" [...\jni]
   *
   *   Lazarus IDE menu:  "Project" --> "View Project Source"
   *   Lazarus IDE menu:  "Project" --> "Forms...."
   *
   *2. Change this informations in "controls.lpi" to correct one!
   *
   *   "C:\adt32\ndk10"   -- just my system NDK path
   *
   *3. Change this informations in  "build.xml"   according your system..
   *   "C:\adt32\sdk"
   *         
   *   Option 1: NEW !!
   *      .IDE --> Tools -->
   *            [Lamw] Android Module Wizard -->
   *               Change Project [*.lpi] Ndk Path [Demos]
   *      .Change/edit "build.xml": "C:\adt32\sdk" according your system..
   *
   *   Option 2: Go to Lazarus IDE:
   *         ->Project
   *         ->Project -> Option
   *         ->Path -->> change/modify paths according to your system ..
   *
   *   Option 3: Open/edit the "controls.lpi" [...\jni] and "build.xml". You can use Notepad like editor....
   *         
   *
   *4. All [compatible] Eclipse projects support Ant!
   *         You can build/install/Run all Eclipse projects just with "Ant"...
   *         see "build.bat" [or .sh] and "install.bat" or [.sh]
   *         or Go To: Lazarus IDE menu "Run--> [Lamw] Build and Run"! Thanks to Anton!!!
   *
   *5.PANIC ? [upgrade your project [or demo] code templates!] !
   *   Lazarus IDE --> menu Tools --> [Lamw] Android Module Wizard --> Upgrade code Templates [*.lpr, *.java]
   *
   *6.PANIC ? When prompt "Read error" [Unknown Property] just choice "Continue Loading" !
   *
   *7.PANIC ? Fail to build Apk. Change according your system installation:
   *
   *   "AndroidManifest.xml"       
   *      <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="17"/>
   *
   *   "build.xml"   
   *      <property name="target"  value="android-17"/>
   *
   *   "build.xml"
   *      <property name="sdk.dir" location="C:\adt32\sdk"/>
   *

But, what about your first "hello world!" apk? all right?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #606 on: August 29, 2015, 07:09:23 pm »
I installed all of a VM Lubuntu . Now I have a problem in compiling the demo , it gives me these errors . Why?!

Code: [Select]
.
.
.
Compila il progetto, OS: android, CPU: arm, Destinazione: /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/libs/armeabi/libcontrols.so.so: Codice di uscita 256, Errori: 4, suggerimenti: 3
unit1.pas(9,22) Hint: Unit "And_jni" not used in unit1
unit1.pas(9,31) Hint: Unit "And_jni_Bridge" not used in unit1
unit1.pas(10,5) Hint: Unit "Laz_And_Controls_Events" not used in unit1
controls.lpr(335,3) Error: Identifier not found "Java_Event_pOnBluetoothClientSocketIncomingMessage"
controls.lpr(343,3) Error: Identifier not found "Java_Event_pOnBluetoothClientSocketWritingMessage"
controls.lpr(359,3) Error: Identifier not found "Java_Event_pOnBluetoothServerSocketIncomingMessage"
controls.lpr(367,3) Error: Identifier not found "Java_Event_pOnBluetoothServerSocketWritingMessage"

Try upgrading code template:

From menu Tools->[Lamw]->Upgrade Code Templates
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #607 on: August 29, 2015, 10:10:37 pm »
Thankk you. But now when run sh build.sh

Code: [Select]
Buildfile: /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.3.4
 [checkenv] Installed at /home/generico/Android/sdk

-setup:
     [echo] Project Name: AppAntDemo1
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 23.0.0
     [echo] Resolving Build Target for AppAntDemo1...
[gettarget] Project Target:   Android 6.0
[gettarget] API level:        23
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/bin/rsObj
    [mkdir] Created dir: /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/bin/rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for AppAntDemo1...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] No changed resources. R.java and Manifest.java untouched.
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 4 source files to /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/bin/classes
    [javac] /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/src/org/lazarus/appantdemo1/Controls.java:280: error: package org.apache.http does not exist
    [javac] import org.apache.http.HttpEntity;
    [javac]                       ^
    [javac] /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/src/org/lazarus/appantdemo1/Controls.java:281: error: package org.apache.http does not exist
    [javac] import org.apache.http.HttpResponse;
    [javac]                       ^
    [javac] /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/src/org/lazarus/appantdemo1/Controls.java:282: error: package org.apache.http does not exist
    [javac] import org.apache.http.NameValuePair;
    [javac]                       ^
    [javac] /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/src/org/lazarus/appantdemo1/Controls.java:283: error: package org.apache.http does not exist
    [javac] import org.apache.http.StatusLine;
    [javac]                       ^
    [javac] /home/generico/Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1/src/org/lazarus/appantdemo1/Controls.java:284: error: package org.apache.http.auth does not exist
    [javac] import org.apache.http.auth.AuthScope;
    [javac]                            ^

and other similar error
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #608 on: August 29, 2015, 10:59:05 pm »
@xinyiman

Quote
...package org.apache.http.auth does not exist

I think you have some problem with the java [configuration] path ... 
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #609 on: August 30, 2015, 10:44:29 am »
@xinyiman

Quote
...package org.apache.http.auth does not exist

I think you have some problem with the java [configuration] path ...
View attachment
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #610 on: August 30, 2015, 03:47:06 pm »
@xinyiman

Quote
...package org.apache.http.auth does not exist

I think you have some problem with the java [configuration] path ...
View attachment

Error is clear:

«package org.apache.http does not exist»

compiler can't find it.

have you adapted build.xml to your system?
have you downloaded the necessary sdk library for your target?
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #611 on: August 30, 2015, 10:15:03 pm »
my build.xml
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<project name="AppAntDemo1" default="help">
  <property name="sdk.dir" location="/home/generico/Android/sdk"/>
  <property name="target" value="android-23"/>
  <property file="ant.properties"/>
  <fail message="sdk.dir is missing." unless="sdk.dir"/>
  <import file="${sdk.dir}/tools/ant/build.xml"/>
</project>

my AndroidManifest.xml
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.lazarus.appantdemo1" android:versionCode="1" android:versionName="1.0">
  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  <uses-permission android:name="android.permission.BLUETOOTH"/>
  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
  <uses-permission android:name="android.permission.CAMERA"/>
  <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.READ_CONTACTS"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.READ_OWNER_DATA"/>
  <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  <uses-permission android:name="android.permission.RESTART_PACKAGES"/>
  <uses-permission android:name="android.permission.SEND_SMS"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.WRITE_OWNER_DATA"/>
  <uses-feature android:name="android.hardware.camera" android:required="false"/>
  <uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
  <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
  <uses-feature android:name="android.hardware.telephony" android:required="false"/>
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
  <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
    <activity android:name="org.lazarus.appantdemo1.App" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|screenSize|screenLayout|fontScale">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
  </application>
</manifest>

View attachment for build log
« Last Edit: August 30, 2015, 10:18:14 pm by xinyiman »
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #612 on: August 30, 2015, 10:28:31 pm »
@xinyiman

what about your first "hello world!" apk? all right?

there is a "readme_get_start.txt" to help ....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #613 on: August 30, 2015, 11:20:26 pm »
Installed API 23 for sdk is this the problem?!
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #614 on: August 31, 2015, 12:20:36 am »
@xinyiman

Quote
...Installed API 23 for sdk is this the problem?!

You can try other  API .... I do not test API 23 ... 
[but if API 23 dropped  apache HttpClient, we have a problem!]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018