androidthings / sample-nativepio

Basic Peripheral I/O examples in C/C++ with Android Things
Apache License 2.0
48 stars 67 forks source link

Build fail #1

Open majo551 opened 7 years ago

majo551 commented 7 years ago

building the sample fails: image

Looks like the project path (variable) uses incorrect slash in the path

tyharness commented 7 years ago

Hello majo551,

Did you get the error using Android Studio? There's a note in the CMakeList.txt.

I've just been through the motions on Linux via the command line. I downloaded latest downloads to my linux box: In the project root folder sample-nativepio-master I copied native-libandroidthings-master and unzipped then I renamed the folder from native-libandroidthings-master to just libandroidthings

Then from the command line (I've got android sdk and ndk in my path): ./gradlew build

and the build was successful.

Using the new dp41 on a rpi I've installed each demo and I made up a breadboard and all the demos worked ok.

majo551 commented 7 years ago

Hi, I retried today on Win7 machine again with the latest updates to Android studio, libandrodithings-0.4.1 and the results is build error. I must have something to do with Windows paths- see error log:(the path segments are with both "/" and "\" but Windows can read only "\" in the paths...

CMake Error at CMakeLists.txt:32 (add_library):

Syntax error in cmake code when parsing string C:\Users\majo551i\Documents\ANDROID\sample-nativepio-master/ android-system-properties/AndroidSystemProperties.cpp

  • Invalid character escape '\U'.*

2017-06-16 11:19 GMT+02:00 tyharness notifications@github.com:

Hello majo551, I've just been through the motions on my linux box: In the project root folder sample-nativepio-master I copied native-libandroidthings-master and unzipped then I renamed the folder to just libandroidthings

from the command line: ./gradlew build

and the build was successful.

I haven't installed over to the device with hardware but I'm sure it'll be ok. Did it last week with dp4.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/androidthings/sample-nativepio/issues/1#issuecomment-308977195, or mute the thread https://github.com/notifications/unsubscribe-auth/AMurCCiqS5QIDCPeHcIxqZQl7rxARqc2ks5sEkikgaJpZM4Nnb0i .

majo551 commented 7 years ago

Hi I replaced the relative path definition in the cmake files at line 33(add library) with project absolute path with the correct path slash "/" character and then the build worked.

Not sure how to correct the CMake in other way , I just simply replaced : add_library(android-system-properties STATIC

${PROJECT_DIR}/android-system-properties/AndroidSystemProperties.cpp) with

add_library(android-system-properties STATIC C:/Users/majo551/Documents/ANDROID/sample-nativepio-master/android-system-properties/AndroidSystemProperties.cpp)

The PROJECT_DIR path is interpreted at this line with the windows path separator "\" which means the escape character and not the path separator needed "/"

2017-07-02 10:15 GMT+02:00 Majo majo551@gmail.com:

Hi, I retried today on Win7 machine again with the latest updates to Android studio, libandrodithings-0.4.1 and the results is build error. I must have something to do with Windows paths- see error log:(the path segments are with both "/" and "\" but Windows can read only "\" in the paths...

CMake Error at CMakeLists.txt:32 (add_library):

Syntax error in cmake code when parsing string C:\Users\majo551i\Documents\ANDROID\sample-nativepio-master/ android-system-properties/AndroidSystemProperties.cpp

  • Invalid character escape '\U'.*

2017-06-16 11:19 GMT+02:00 tyharness notifications@github.com:

Hello majo551, I've just been through the motions on my linux box: In the project root folder sample-nativepio-master I copied native-libandroidthings-master and unzipped then I renamed the folder to just libandroidthings

from the command line: ./gradlew build

and the build was successful.

I haven't installed over to the device with hardware but I'm sure it'll be ok. Did it last week with dp4.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/androidthings/sample-nativepio/issues/1#issuecomment-308977195, or mute the thread https://github.com/notifications/unsubscribe-auth/AMurCCiqS5QIDCPeHcIxqZQl7rxARqc2ks5sEkikgaJpZM4Nnb0i .

proppy commented 6 years ago

Do you have the same error with a more recent version of windows (ex: 10) ?