Closed dah-fari7009 closed 1 year ago
Hi,
Maybe you can check the version of Android SDK Tools, the "android create project" command is removed in versions > 25.2.3.
“Prepare Android environment ( Android SDK installation information, https://developer.android.com/), the version of Android SDK Tools should be lower than 25.2.3.”
Thanks for the quick reply! I used to have the version problem and the error message was "Unsupported command create project", so I explicitly downgraded my Android SDK Tools version to 25.2.2, which then led me to the error message above.
Update: I tried running the create project command directly and figured out it was an issue with the targeted API level missing from my machine. I now get a NullPointerException from Soot. I will look more into it and create a separate issue, thank you for you help!
Can this command "android create project --name PlutoTV_5_21_1_apkcombo_com --target android-23 --path Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombocom --package fax.tv.pluto.android --activity Activity " be executed successfully in the shell without Fax? This command should output an android project with plenty of files.
Yes, I can successfully run the command, however there seems to be some issue with the ant build afterwards and no APK is outputted. I'm not sure if this is what leads to the Soot error during instrumentation afterwards :
java.io.FileNotFoundException: Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/PlutoTV_5_21_1_apkcombo_com-debug.apk (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:125)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:115)
at com.google.common.io.ByteSource.copyTo(ByteSource.java:239)
at com.google.common.io.Files.copy(Files.java:305)
at com.google.common.io.Files.move(Files.java:490)
at utils.Utils.moveFile(Utils.java:186)
at generator.TestGenerator.moveGeratedAPK(TestGenerator.java:122)
at generator.TestGenerator.buildProject(TestGenerator.java:785)
at generator.TestGenerationofAll.analyze(TestGenerationofAll.java:110)
at main.Main.analyzeSingleApk(Main.java:206)
at main.Main.generateTestCase(Main.java:167)
at main.Main.analyzeArgs(Main.java:118)
at main.Main.main(Main.java:54)
TestGeneration Finish...
When I tried running the ant command directly from the terminal, I obtained this error message:
ant debug -buildfile Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/build.xml
Buildfile: /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 25.2.2
[checkenv] Installed at /data/Faridah/android
-setup:
[echo] Project Name: PlutoTV_5_21_1_apkcombo_com
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 32.0.0
[echo] Resolving Build Target for PlutoTV_5_21_1_apkcombo_com...
[gettarget] Project Target: Android 7.1.1
[gettarget] API level: 25
[gettarget] WARNING: No minSdkVersion value set. Application will install on all Android versions.
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/rsObj
[mkdir] Created dir: /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/rsLibs
[echo] ----------
[echo] Resolving Dependencies for PlutoTV_5_21_1_apkcombo_com...
[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 21 source files to /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/bin/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/src/fax/tv/pluto/android/Activity_1.java:45: error: cannot find symbol
[javac] Button button1=(Button)findViewById(R.id.button1);
[javac] ^
[javac] symbol: variable id
[javac] location: class R
[javac] /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/src/fax/tv/pluto/android/Activity_10.java:43: error: cannot find symbol
[javac] Button button1=(Button)findViewById(R.id.button1);
[javac] ^
[javac] symbol: variable id
[javac] location: class R
[javac] /data/Faridah/exploration-tools/Fax/Result_testGen/testcases/PlutoTV_5.21.1_apkcombo.com/generatedApp/PlutoTV_5_21_1_apkcombo_com/src/fax/tv/pluto/android/Activity_11.java:42: error: cannot find symbol
[javac] Button button1=(Button)findViewById(R.id.button1);
[javac] ^
[javac] symbol: variable id
[javac] location: class R
...
[javac] 17 errors
[javac] 3 warnings
BUILD FAILED
/data/Faridah/android/tools/ant/build.xml:716: The following error occurred while executing this line:
/data/Faridah/android/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.
I'll move this comment to a new issue as it's unrelated
Hi,
When I try running the tool on an apk, I get the following error after the "Start Test Generation" phase.
The "generatedApp" folder only contains res/layout/main.xml. Do you have any idea what could be causing this problem?