I am using* Android Studio 1.5* and* NDK r10e (64-bit)*.
Here i am trying to compile your sample project (*Android-PRNG*).
So, I downloaded the project from github link and imported it into Android
Studio 1.5.
Now the *project structure* looks like
Android-PRNG-Master
|
--------- app
|
---------- src
|
------------ main
|
----------- java
jni
*Gradle Looks as :*
apply plugin: 'com.android.application'
compileSdkVersion 15
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.cryptopp.prng"
minSdkVersion 9
targetSdkVersion 9
ndk {
moduleName "prng"
stl "stlport_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.txt'
}
}
I added
moduleName "prng"
stl "stlport_shared"
inside ndk{}
*The executive summary from "Android (Command Line)" :*
Executed below After setting *ANDROID_SDK_ROOT *and *ANDROID_NDK_ROOT *
git clone https://github.com/weidai11/cryptopp.git
cd cryptopp
wget https://www.cryptopp.com/w/images/0/0a/Setenv-android.sh.zip
unzip -aoq Setenv-android.sh.zip
. ./setenv-android.sh armeabi stlport
make -f GNUmakefile-cross distclean
make -f GNUmakefile-cross static dynamic
sudo make install PREFIX=/usr/local/cryptopp/android-armeabi
Repeated this for multiple architecture
- /usr/local/cryptopp/android-armeabi
- /usr/local/cryptopp/android-armeabi-v7a
- /usr/local/cryptopp/android-mips
- /usr/local/cryptopp/android-x86
- /usr/local/cryptopp/android-x86_64
Every time after executing for each arch it wont past .so file into lib folder
but only has .a file, so i manually pasted .so into lib.
*In Android.mk :*
Here i changed path for
STLPORT_INCL :=
/Users/kasbahapple/Documents/AndroidDocs/AndroidADT/adt-bundle-mac-x86_64-20140702/sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/
STLPORT_LIB :=
/Users/kasbahapple/Documents/AndroidDocs/AndroidADT/adt-bundle-mac-x86_64-20140702/sdk/ndk-bundle/sources/cxx-stl/stlport/libs/$(TARGET_ARCH_ABI)
*ndk-build :*
In terminal i went into a directory *main *and executed *ndk-build*
now under main it creates libs and obj folder with corresponding
architecture files successfully without any problem
*Error :*
Now the error creates when doing rebuild-project from android studio..
Error:(59, 28) cryptopp/osrng.h: No such file or directory
:app:compileDebugAndroidTestRenderscript
:app:checkDebugManifest
:app:generateDebugAndroidTestSources
:app:processDebugAndroidTestManifest
:app:mergeDebugAndroidTestAssets
:app:compileDebugAndroidTestAidl
:app:clean
:app:mergeDebugResources
:app:processDebugManifest
:app:compileDebugJavaWithJavac
:app:generateDebugAssets UP-TO-DATE
:app:processDebugResources
Information:Total time: 48.7 secs
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/Users/kasbahapple/Documents/AndroidDocs/AndroidADT/adt-bundle-mac-x86_64-20140702/sdk/ndk-bundle/ndk-build''
finished with non-zero exit value 2
:app:preBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
Information:2 errors
:app:compileDebugRenderscript
:app:generateDebugResValues UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
Information:0 warnings
make: ***
[/Users/kasbahapple/Documents/CHATTER/AndroidProj/Android-PRNG-master1/app/build/intermediates/ndk/debug/obj/local/arm64-v8a/objs/prng//Users/kasbahapple/Documents/CHATTER/AndroidProj/Android-PRNG-master1/app/src/main/jni/libprng.o]
Error 1
:app:generateDebugBuildConfig
:app:mergeDebugAndroidTestResources
:app:mergeDebugAssets
Information:Gradle tasks [clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:compileDebugSources,
:app:compileDebugAndroidTestSources]
:app:prepareDebugDependencies
/Users/kasbahapple/Documents/CHATTER/AndroidProj/Android-PRNG-master1/app/src/main/jni/libprng.cpp
:app:generateDebugSources
:app:generateDebugResources
Information:BUILD FAILED
:app:generateDebugAndroidTestBuildConfig
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:compileDebugAidl
Error:(59, 28) cryptopp/osrng.h: No such file or directory
compilation terminated.
:app:compileDebugNdk
make: ***
[/Users/kasbahapple/Documents/CHATTER/AndroidProj/Android-PRNG-master1/app/build/intermediates/ndk/debug/obj/local/arm64-v8a/objs/prng//Users/kasbahapple/Documents/CHATTER/AndroidProj/Android-PRNG-master1/app/src/main/jni/libprng.o]
Error 1
Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/Users/kasbahapple/Documents/AndroidDocs/AndroidADT/adt-bundle-mac-x86_64-20140702/sdk/ndk-bundle/ndk-build''
finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 48.7 secs
Information:2 errors
Information:0 warnings
Why this problem occurs is am doing wrong?
On Thursday, December 10, 2015 at 10:31:16 PM UTC+5:30, Jeffrey Walton
wrote:
>
> On Thursday, December 10, 2015 at 4:42:10 AM UTC-5, Jeeva S K wrote:
>>
>> Hi Jeffrey Walton,
>>
>> How to solve
>>
>> #include <cryptopp/osrng.h>
>>
>> *cryptopp/osrng.h: No such file or directory*
>>
>> Before this i built CryptoPP for different architecture as you mentioned
>>
>
> If its Eclipse, then you need to add the path to the Android source file
> to the project properties. But I'm pretty sure Eclipse and the ADT are just
> about completely broken now. Under the latest SDKs, Eclipse cannot locate
> files like <jni.h> and <android/*>.
>
> If its not Eclipse, then you need to tell us more.
>
> Jeff
>
--
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.